comparison gui/wm/ws.c @ 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
comparison
equal deleted inserted replaced
34007:ad0284b699c1 34008:f452c09078e6
926 // Switch to fullscreen. 926 // Switch to fullscreen.
927 // ---------------------------------------------------------------------------------------------- 927 // ----------------------------------------------------------------------------------------------
928 void wsFullScreen(wsTWindow *win) 928 void wsFullScreen(wsTWindow *win)
929 { 929 {
930 if (win->isFullScreen) { 930 if (win->isFullScreen) {
931 vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_REMOVE); // removes fullscreen state if wm supports EWMH 931 if (vo_fs_type & vo_wm_FULLSCREEN)
932 932 /* window manager supports EWMH */
933 if (!(vo_fs_type & vo_wm_FULLSCREEN)) { // shouldn't be needed with EWMH fs 933 vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_REMOVE);
934 else {
934 win->X = win->OldX; 935 win->X = win->OldX;
935 win->Y = win->OldY; 936 win->Y = win->OldY;
936 win->Width = win->OldWidth; 937 win->Width = win->OldWidth;
937 win->Height = win->OldHeight; 938 win->Height = win->OldHeight;
938 } 939 }
939 940
940 win->isFullScreen = False; 941 win->isFullScreen = False;
941 } else { 942 } else {
942 vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_ADD); // adds fullscreen state if wm supports EWMH 943 if (vo_fs_type & vo_wm_FULLSCREEN)
943 944 /* window manager supports EWMH */
944 if (!(vo_fs_type & vo_wm_FULLSCREEN)) { // shouldn't be needed with EWMH fs 945 vo_x11_ewmh_fullscreen(win->WindowID, _NET_WM_STATE_ADD);
946 else {
945 win->OldX = win->X; 947 win->OldX = win->X;
946 win->OldY = win->Y; 948 win->OldY = win->Y;
947 win->OldWidth = win->Width; 949 win->OldWidth = win->Width;
948 win->OldHeight = win->Height; 950 win->OldHeight = win->Height;
949 } 951 }
957 if (vo_wm_type == 0 && !(vo_fsmode & 16)) { 959 if (vo_wm_type == 0 && !(vo_fsmode & 16)) {
958 XUnmapWindow(wsDisplay, win->WindowID); // required for MWM 960 XUnmapWindow(wsDisplay, win->WindowID); // required for MWM
959 XWithdrawWindow(wsDisplay, win->WindowID, wsScreen); 961 XWithdrawWindow(wsDisplay, win->WindowID, wsScreen);
960 } 962 }
961 963
962 if (!(vo_fs_type & vo_wm_FULLSCREEN)) { // shouldn't be needed with EWMH fs 964 /* restore window if window manager doesn't support EWMH */
965 if (!(vo_fs_type & vo_wm_FULLSCREEN)) {
963 wsWindowDecoration(win, win->Decorations && !win->isFullScreen); 966 wsWindowDecoration(win, win->Decorations && !win->isFullScreen);
964 vo_x11_sizehint(win->X, win->Y, win->Width, win->Height, 0); 967 vo_x11_sizehint(win->X, win->Y, win->Width, win->Height, 0);
965 wsSetLayer(wsDisplay, win->WindowID, win->isFullScreen); 968 wsSetLayer(wsDisplay, win->WindowID, win->isFullScreen);
966 XMoveResizeWindow(wsDisplay, win->WindowID, win->X, win->Y, win->Width, win->Height); 969 XMoveResizeWindow(wsDisplay, win->WindowID, win->X, win->Y, win->Width, win->Height);
967 } 970 }