]> git.decadent.org.uk Git - ion3.git/commitdiff
Added workaround for Flash full-screen bug (#462690).
authorBen Hutchings <ben@decadent.org.uk>
Mon, 28 Jan 2008 00:05:37 +0000 (00:05 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 2 Nov 2008 12:45:41 +0000 (12:45 +0000)
debian/cfg_kludge_flash.lua [new file with mode: 0644]
debian/ion3.README.Debian
debian/ion3.install

diff --git a/debian/cfg_kludge_flash.lua b/debian/cfg_kludge_flash.lua
new file mode 100644 (file)
index 0000000..54fca80
--- /dev/null
@@ -0,0 +1,45 @@
+-- Flash player opens full-screen windows from Firefox with size
+-- request 200x200.  It closes them if they lose focus, but also if
+-- they get focus too quickly.  Therefore set focus 200 ms after
+-- such a window is mapped (this may need to be adjusted on slower
+-- computers).
+
+_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',
+    match = function(prop, cwin, id)
+               local geom = cwin:geom()
+               return is_fullscreen(cwin) and geom.w == 200 and geom.h == 200
+           end,
+    switchto = false,
+    flash_fullscreen = true,
+}
+
+ioncore.get_hook('clientwin_do_manage_alt'):add(
+    function(cwin, table)
+       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
+)
index 4db759cc171f80fa9eb42d67404f00a0ffdead6b..d8420072d007aafda02cc6faf4e7d48e39bb4aa6 100644 (file)
@@ -81,4 +81,15 @@ postinst script to add the configuration file
 /etc/X11/ion3/cfg_foo.lua.  Run "install-ion3-cfg --remove cfg_foo" in
 the prerm script to remove it.
 
- -- Ben Hutchings <ben@decadent.org.uk>, Thu, 27 Sep 2007 22:27:11 +0100
+Compatibility with Flash full-screen mode
+-----------------------------------------
+
+The official Flash plugin (flashplugin-nonfree) can open full-screen
+windows.  Version 9 has a bug in this feature which causes these windows
+to close immediately if they are managed by Ion3.  This package includes
+a workaround, but it is ugly and is not enabled by default.  If you
+need it, add this to cfg_ion.lua:
+
+    dopath("cfg_kludge_flash")
+
+ -- Ben Hutchings <ben@decadent.org.uk>  Sun, 27 Jan 2008 23:50:12 +0000
index 4d58e30814d896362e95914ae26cf5689977390f..8f7c28e3b8d12694c8b0d09860e95adc91d6ced2 100644 (file)
@@ -2,3 +2,4 @@ debian/ion3.desktop debian/pwm3.desktop usr/share/xsessions
 debian/default etc
 debian/watch usr/share/ion3/debian
 debian/install-ion3-cfg usr/sbin
+debian/cfg_kludge_flash.lua etc/X11/ion3