# HG changeset patch # User ib # Date 1315578605 0 # Node ID f452c09078e653cf9e7635a714f96a1d0a14aa1d # Parent ad0284b699c1641fbb2c2715ecd67d923a68ece1 Collect EWMH and non-EWMH code in wsFullScreen() by an if-else statement. Additionally, change comments for EWMH and non-EWMH code. diff -r ad0284b699c1 -r f452c09078e6 gui/wm/ws.c --- 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);