View Full Version : Fullscreen toggle / Kiosk mode for any window
nil
February 13th, 2007, 06:11 PM
Perhaps the sole feature I miss from metacity is the ability to switch any window to fullscreen. Many apps do this by themselves (browser, pdf reader, image viewer, etc) but some do not.
Personally I’d like to run gvim in fullscreen sometimes. Metacity can do it and apparently Beryl has gotten kiosk mode in this commit: http://bugs.beryl-project.org/changeset/773 .
mikedee
February 13th, 2007, 06:52 PM
Can you try this plugin and see if its working as you expect. I just copied the function into a plugin. There is no special reason it has to go in core, but it might make sense.
http://www.anykeysoftware.co.uk/compiz/plugins/kiosk.tar.gz
nil
February 15th, 2007, 04:09 AM
Fantastic. You rock! It works exactly as it should.
Now the question whther this should remain a plugin depends on whether you want feature parity with Metacity. For me this function is similar to toggle_maximize_{horizontally,vertically}, which are in the general section.
But a plugin suffices completely.
Thanks a bunch.
Amaranth
February 15th, 2007, 04:25 AM
If it works as a plugin then putting it in core is probably not a good idea. :)
lowfi
February 17th, 2007, 12:57 PM
Mike, I've been going through the code and changed a few things.
1) The override redirect test is necessary to catch pop-up windows.
2) I removed the maxmize specific things and added some window tests from
minimzeWindow which apply to fullscreen as well.
3) Initiate should return false if finding the toplevel window fails.
static Bool
fullscreenWindow (CompWindow * w)
{
Bool onDesktop = onCurrentDesktop (w);
if (!w->managed || w->attrib.override_redirect)
return FALSE;
if (w->minimized || w->inShowDesktopMode || w->hidden || !onDesktop)
return FALSE;
w->state ^= CompWindowStateFullscreenMask;
w->state = constrainWindowState (w->state, w->actions);
recalcWindowType (w);
recalcWindowActions (w);
(*w->screen->windowStateChangeNotify) (w);
updateWindowAttributes (w, FALSE);
setWindowState (w->screen->display, w->state, w->id);
return TRUE;
}
and in kioskInitiate
w = findTopLevelWindowAtDisplay (d, xid);
if (w)
return fullscreenWindow (w);
return FALSE;
I think we should send a patch to the mailing list, because this is a core WM feature. As nil said Metacity has a "toggle_fullscreen" option, so I'm sure david will accept it.
btw, file upload for the board !!!! Please . :D
mikedee
February 17th, 2007, 06:07 PM
Thanks for the modifications lowfi :)
I have uploaded a new version of the plugin.
The code was ripped straight from the linked patch, there are good reasons for and against the inclusion in core. Like Amaranth says, if its possible in a plugin it should stay there, but the other window management key bindings are also in core. We could still have the option like metacity if the plugin was loaded so we will not lose any functionality.
nil
February 20th, 2007, 07:29 PM
Hi, a small peeve crept up. The visual bell that I set to window shivering is very slow when the window is set to fullscreen.
Is there a way to prevent sending the visual bell to the wobbly pluhgin when in kiosk mode?
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.