Canaan Hadley-Voth | 5 Dec 04:16
Picon

scratchpad sizepolicy problem

More on this issue:

http://article.gmane.org/gmane.comp.window-managers.ion.general/8897/match=scratchpad (Scratchpad stuck in max size "mode")

If my scratchpad is touching any screen border when I restart, ion will forget to write sizepolicy="free glue" to the saved_layout.lua file, and after restarting it will then take up the whole screen and not be resizeable.  If the scratchpad is not touching any border when I restart, saved_layout will show the "free glue" entry for *scratchpad* and will function properly.

Windows Live Hotmail gives you a free,exclusive gift. Click here to download.
Picon
Favicon

Re: scratchpad sizepolicy problem

Thanks a lot for finding the condition for this bug!

The problem is this: Moving the scratchpad eventually ends up in "sizepolicy_free_snap" (seems to have
been in-lined in the build I debugged)

#0  sizepolicy (szplcy=0x88f998c, reg=0x88f93e8, rq_geom=0xbfd774cc, rq_flags=<value optimized
out>, fp=0xbfd773e0) at sizepolicy.c:194
#1  0x08073852 in group_managed_rqgeom (ws=0x88f8fa8, reg=0x88f93e8, rq=0xbfd774cc,
geomret=0x891d468) at group.c:997
#2  0x08065c21 in region_managed_rqgeom (mgr=0x88f8fa8, reg=0x88f93e8, rq=0xbfd774cc,
geomret=0x891d468) at resize.c:593
#3  0x08065e83 in region_rqgeom (reg=0x88f93e8, rq=0xbfd774cc, geomret=0x891d468) at resize.c:531
#4  0x08066514 in moveresmode_do_newgeom (mode=0x891d408, rq=0xbfd774cc) at resize.c:336
#5  0x0806679b in moveresmode_delta (mode=0x891d408, dx1=<value optimized out>, dx2=<value optimized
out>, dy1=-6, dy2=-6, rret=0x0) at resize.c:423
#6  0x0805ec7d in ioncore_do_handle_motionnotify (ev=0xbfd77644) at pointer.c:176
#7  0x080653bc in ioncore_handle_buttonpress (ev=0xbfd77644) at eventh.c:493
#8  0x08065705 in ioncore_handle_event (ev=0xbfd773e0) at eventh.c:81
#9  0x0807a92d in hook_call_alt (hk=0x88246f8, p=0xbfd77644, m=0x807a8b1 <marshall_alt_p>, em=0) at hooks.c:371
#10 0x0807a9ff in hook_call_alt_p (hk=0x88246f8, p=0xbfd77644, em=0) at hooks.c:416
#11 0x0805cd37 in ioncore_x_connection_handler (conn=10, unused=0x0) at event.c:210
#12 0x0807997c in mainloop_select () at select.c:88
#13 0x0805ce1f in ioncore_mainloop () at event.c:238
#14 0x0805b631 in main (argc=) at ion.c:278

Here the sizepolicy is combined with border modifiers (e.g. SIZEPOLICY_HORIZ_LEFT) if the scratchpad is
at one of the borders.

This results in a sizepolicy without a string representation (szplcy_specs, sizepolicy.c:311), so when
stringpolizy2string is called when the layout is saved it returns NULL.

The following small patch fixes the issue: (done against ion3plus with latest patchset)

hunk ./ioncore/sizepolicy.c 363
-    return stringintmap_key(szplcy_specs, szplcy, NULL);
+    char* str=stringintmap_key(szplcy_specs, szplcy, NULL);
+    if(str==NULL){
+        /* fall back on policy without modifiers if full name not found */
+        str=stringintmap_key(szplcy_specs, szplcy&0xff, NULL);
+    }
+    return str;

On Sat, 05 Dec 2009 04:16:23 +0100, Canaan Hadley-Voth
<ugggg@...> wrote:

>
> More on this issue:
>
> http://article.gmane.org/gmane.comp.window-managers.ion.general/8897/match=scratchpad
(Scratchpad stuck in max size "mode")
>
> If my scratchpad is touching any screen border when I restart, ion will forget to write sizepolicy="free
glue" to the saved_layout.lua file, and after restarting it will then take up the whole screen and not be
resizeable.  If the scratchpad is not touching any border when I restart, saved_layout will show the "free
glue" entry for *scratchpad* and will function properly.
>  		 	   		
> _________________________________________________________________
> Windows Live Hotmail gives you a free,exclusive  gift.
> http://www.microsoft.com/windows/windowslive/hotmail_bl1/hotmail_bl1.aspx?ocid=PID23879::T:WLMTAGL:ON:WL:en-ww:WM_IMHM_7:092009

Canaan Hadley-Voth | 6 Dec 03:34
Picon

Re: Youtube fullscreen not working

Ben Hutchings <ben@...> writes:

> > [1] http://git.decadent.org.uk/gitweb?p=ion3.git;a=blob;f=debian/
cfg_kludge_flash.lua
> 

Your script works for me, thanks for solving that.  I was actually fine when 
this thread started, then Ubuntu 9.10 came along and flash windows would try to 
fullscreen themselves and quickly fail.  

For others with the same problem, these are the classes and instances I find 
for that flash window that disappears too fast, for use in the above script:

defwinprop {
    class = "Operapluginwrapper-ia32-linux",
    instance = "operapluginwrapper-ia32-linux",
    match = function(prop, cwin, id) return is_fullscreen(cwin); end,
    switchto = false,
    flash_fullscreen = true,
}
defwinprop {
    class = "Firefox",
    instance = "firefox",
    name = "Firefox",
    match = function(prop, cwin, id) return is_fullscreen(cwin); end,
    switchto = false,
    flash_fullscreen = true,
}
defwinprop {
    class = "Prism",
    instance = "prism",
    match = function(prop, cwin, id) return is_fullscreen(cwin); end,
    switchto = false,
    flash_fullscreen = true,
}
defwinprop {
    class = "Exe",  -- google chrome
    instance = "exe",
    name = "exe",
    match = function(prop, cwin, id) return is_fullscreen(cwin); end,
    switchto = false,
    flash_fullscreen = true,
}

I understand they vary by distro, so here is a hook to figure out the rest:

ioncore.get_hook('clientwin_do_manage_alt'):add(
    function(cwin, table)
    ioncore.write_savefile("windowinfos", cwin:get_ident())
end)

Then restart ion, fullscreen a flash video and see what got written to ~/.ion3/
default-session--0/windowinfos.lua

Timandahaf | 6 Dec 23:58
Picon

Re: Youtube fullscreen not working

On Sun, 6 Dec 2009, Canaan Hadley-Voth wrote:

> I understand they vary by distro, so here is a hook to figure out the rest:
> [...]
> Then restart ion, fullscreen a flash video and see what got written to ~/.ion3/
> default-session--0/windowinfos.lua

Ah, thank you very much for this hook! I finally got youtube fullscreen
working perfectly well!

My class,instance for the misbehaving youtube window was
"Npviewer.bin","npviewer.bin". This is why the original kludge wouldn't
work (I'd previously used ion3's windowinfo to setup my kludge, but I
guess this gave me only the parent's info).

cc | 8 Dec 18:12
Picon

problem with french keyboard

I've a French keyboard and I used
    META.."oe"
for the scratchpad (the key left of number 1).
It worked well when I launched X with gdm.

Now I don't use gdm anymore and launch ion with startx. And the key only
works after a restart of ion (with F12).
The other keys seem to work.

Any idea of what gdm does to make that key available and why it works
after a restart ?
[I'm on Debian Lenny]

Tuomo Valkonen | 10 Dec 18:42
Picon
Picon
Favicon

Re: problem with french keyboard

On 2009-12-08 18:12 +0100, cc wrote:
> I've a French keyboard and I used
>     META.."oe"
> for the scratchpad (the key left of number 1).
> It worked well when I launched X with gdm.
> 
> Now I don't use gdm anymore and launch ion with startx. And the key only
> works after a restart of ion (with F12).

You must set up the keymap. Thank the gnometards for 
reinventing the wheel.

--

-- 
Tuomo

Tony Emma | 13 Dec 23:38
Picon

Youtube fullscreen not working

Hello

thank you for ION.

I have the same problem i can't use fullscreen mode. I try your solution but it's don't work.

I had ioncore.write_savefile("windowinfos", cwin:get_ident()) but there is not file "windowinfos.lua"

I'm on Debian and i use iceweasel.

uname -a
Linux LMG 2.6.31-1-amd64 #1 SMP Mon Nov 16 04:44:38 UTC 2009 x86_64 GNU/Linux

and i use iceweasel. I had the block

defwinprop {
    class = 'Iceweasel',
    instance = 'Navigator',
    match = function(prop, cwin, id) return is_fullscreen(cwin); end,
    switchto = false,
    flash_fullscreen = true,
}

but nothing.



See my cfg_kludge_flash.lua:

_NET_WM_STATE = ioncore.x_intern_atom('_NET_WM_STATE', false)
_NET_WM_STATE_FULLSCREEN = ioncore.x_intern_atom('_NET_WM_STATE_FULLSCREEN',
                                                 false)

function is_fullscreen(cwin)
    local state = ioncore.x_get_window_property(cwin:xid(), _NET_WM_STATE, 4,
                                                1, true)
    if state then
        for k, v in pairs(state) do
            if v == _NET_WM_STATE_FULLSCREEN then
                return true
            end
        end
    end
    return false
end

defwinprop {
    class = 'Firefox-bin',
    instance = 'Firefox-bin',
--    match = function(prop, cwin, id)
--              local geom = cwin:geom()
--              return is_fullscreen(cwin) and geom.w == 200 and geom.h == 200
--          end,

    match = function(prop, cwin, id) return is_fullscreen(cwin); end,
    switchto = false,
    flash_fullscreen = true,
}

defwinprop {
    class = 'Iceweasel',
    instance = 'Navigator',
--    match = function(prop, cwin, id)
--              local geom = cwin:geom()
--              return is_fullscreen(cwin) and geom.w == 200 and geom.h == 200
--          end,

    match = function(prop, cwin, id) return is_fullscreen(cwin); end,
    switchto = false,
    flash_fullscreen = true,
}


ioncore.get_hook('clientwin_do_manage_alt'):add(
    function(cwin, table)
        --ioncore.write_savefile("windowinfos", cwin:get_ident())
        local winprop = ioncore.getwinprop(cwin)
        if winprop and winprop.flash_fullscreen then
            local timer = ioncore.create_timer()
            timer:set(200, function() cwin:goto() end)
            return true
        else
            return false
        end
    end
)


Please help me

ebik | 14 Dec 07:18
Picon

Re: Youtube fullscreen not working


I think you were looking  for windowinfos.lua in wrong directory.
It is not saved into .ion3/ itself, but in .ion3/default-session-0/
(if you did not changed your ion session directory).

>     class = 'Firefox-bin',
>     instance = 'Firefox-bin',

Here I think that instance should be lowercase, but I'm not sure.
First try to omit instance.

Also the script may not work in specific circumstances. I have two
computers, but only on one is the solution working reliably. (The
other computer is old, some plugins in iceweasel installed etc.)

--

-- 
                                 Tomáš 'ebík' Ebenlendr
                                 PF 2009.95150459792

Tony Emma | 14 Dec 21:27
Picon

Re: Youtube fullscreen not working

Hello ebik.

So the problem with the file windowinfos is due to configuration. I must add in file cfg_kludges.lua:

dopath("cfg_kludge_flash.lua")

Now i have a file. See the content:
-- Ce fichier a été généré par Ion, Ne pas éditer.
return {
    ["instance"] = "xterm",
    ["class"] = "UXTerm",
}

I create a block in my file cfg_kludge_flash.lua

defwinprop {
    class = 'UXTerm',
    instance = 'xterm',
    --match = function(prop, cwin, id)


    --          local geom = cwin:geom()
    --          return is_fullscreen(cwin) and geom.w == 200 and geom.h == 200
    --      end,

    match = function(prop, cwin, id) return is_fullscreen(cwin); end,
    switchto = false,
    flash_fullscreen = true,
}

The fullscreen mode doesn't work. :(

I try this:
defwinprop {
    class = 'UXTerm',
    instance = 'xterm',

    match = function(prop, cwin, id)
              local geom = cwin:geom()
              return is_fullscreen(cwin) and geom.w == 200 and geom.h == 200
          end,

    --match = function(prop, cwin, id) return is_fullscreen(cwin); end,
    switchto = false,
    flash_fullscreen = true,
}

The fullscreen mode stay few seconds then it disappear

Have you any ideas?

Tony

2009/12/14 ebik <ebik <at> drak.ucw.cz>

I think you were looking  for windowinfos.lua in wrong directory.
It is not saved into .ion3/ itself, but in .ion3/default-session-0/
(if you did not changed your ion session directory).

>     class = 'Firefox-bin',
>     instance = 'Firefox-bin',

Here I think that instance should be lowercase, but I'm not sure.
First try to omit instance.

Also the script may not work in specific circumstances. I have two
computers, but only on one is the solution working reliably. (The
other computer is old, some plugins in iceweasel installed etc.)

--
                                Tomáš 'ebík' Ebenlendr
                                PF 2009.95150459792



Canaan Hadley-Voth | 14 Dec 22:20
Picon

Re: Youtube fullscreen not working

Tony Emma <tony.emma62@...> writes:
> 
>     class = 'UXTerm',
>     instance = 'xterm',
> 

I see that you're following the instruction "restart ion, fullscreen a flash 
video and see what got written to windowinfos.lua" very precisely, but in the 
act of "see what got written" you're opening an xterm window, and 
windowinfos.lua only shows you the *last* client window opened, in your case 
the xterm.  So open xterm first, then fullscreen a flash video, then enter the 
command in the terminal that would read the file windowinfos.lua.

If it still fails when you get the right class and instance, the author of 
script warned that the delay may need to be adjusted on some computers, which 
means changing the number in "timer:set(200, function() cwin:goto() end)".


Gmane