changeset 34008:f452c09078e6

Collect EWMH and non-EWMH code in wsFullScreen() by an if-else statement. Additionally, change comments for EWMH and non-EWMH code.
author ib
date Fri, 09 Sep 2011 14:30:05 +0000
parents ad0284b699c1
children 5c33025ccfd8
files gui/wm/ws.c
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gui/wm/ws.c	Fri Sep 09 14:18:56 2011 +0000
+++ b/gui/wm/ws.c	Fri Sep 09 14:30:05 2011 +0000
@@ -928,9 +928,10 @@
 void wsFullScreen(wsTWindow *win)
 {
     if (win->isFullScreen) {
-        vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_REMOVE); // removes fullscreen state if wm supports EWMH
-
-        if (!(vo_fs_type & vo_wm_FULLSCREEN)) { // shouldn't be needed with EWMH fs
+        if (vo_fs_type & vo_wm_FULLSCREEN)
+            /* window manager supports EWMH */
+            vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_REMOVE);
+        else {
             win->X      = win->OldX;
             win->Y      = win->OldY;
             win->Width  = win->OldWidth;
@@ -939,9 +940,10 @@
 
         win->isFullScreen = False;
     } else {
-        vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_ADD); // adds fullscreen state if wm supports EWMH
-
-        if (!(vo_fs_type & vo_wm_FULLSCREEN)) { // shouldn't be needed with EWMH fs
+        if (vo_fs_type & vo_wm_FULLSCREEN)
+            /* window manager supports EWMH */
+            vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_ADD);
+        else {
             win->OldX      = win->X;
             win->OldY      = win->Y;
             win->OldWidth  = win->Width;
@@ -959,7 +961,8 @@
         XWithdrawWindow(wsDisplay, win->WindowID, wsScreen);
     }
 
-    if (!(vo_fs_type & vo_wm_FULLSCREEN)) { // shouldn't be needed with EWMH fs
+    /* restore window if window manager doesn't support EWMH */
+    if (!(vo_fs_type & vo_wm_FULLSCREEN)) {
         wsWindowDecoration(win, win->Decorations && !win->isFullScreen);
         vo_x11_sizehint(win->X, win->Y, win->Width, win->Height, 0);
         wsSetLayer(wsDisplay, win->WindowID, win->isFullScreen);