From 15e37ff942298bd2233a84d2d0f84f14d9f16708 Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Mon, 12 Oct 2009 00:08:21 +0200 Subject: [PATCH] Remove #ifdef NETWM_HINTS constructs NETWM_HINT is always defined in src/wconfig.h.in, so let's remove it from there too. --- src/actions.c | 61 ++++++++++--------------------------------------------- src/application.c | 2 -- src/client.c | 6 +----- src/dialog.c | 2 -- src/event.c | 7 +------ src/icon.c | 8 +------- src/moveres.c | 6 +++--- src/screen.c | 14 +++---------- src/screen.h | 2 -- src/wconfig.h.in | 2 -- src/window.c | 12 +---------- src/window.h | 5 ----- src/winspector.c | 7 ------- src/wmspec.c | 4 ---- src/workspace.c | 14 ------------- 15 files changed, 21 insertions(+), 131 deletions(-) diff --git a/src/actions.c b/src/actions.c index 5cb0f40b..ad1a69b7 100644 --- a/src/actions.c +++ b/src/actions.c @@ -976,11 +976,7 @@ void wIconifyWindow(WWindow * wwin) GrabModeAsync, None, None, CurrentTime); } - if (!wPreferences.disable_miniwindows -#ifdef NETWM_HINTS - && !wwin->flags.net_handle_icon -#endif - ) { + if (!wPreferences.disable_miniwindows && !wwin->flags.net_handle_icon) { if (!wwin->flags.icon_moved) { PlaceIcon(wwin->screen_ptr, &wwin->icon_x, &wwin->icon_y, wGetHeadForWindow(wwin)); } @@ -1003,11 +999,7 @@ void wIconifyWindow(WWindow * wwin) * something before the animation starts (and the server is grabbed) */ XSync(dpy, 0); - if (wPreferences.disable_miniwindows -#ifdef NETWM_HINTS - || wwin->flags.net_handle_icon -#endif - ) + if (wPreferences.disable_miniwindows || wwin->flags.net_handle_icon) wClientSetState(wwin, IconicState, None); else wClientSetState(wwin, IconicState, wwin->icon->icon_win); @@ -1018,25 +1010,18 @@ void wIconifyWindow(WWindow * wwin) && !wPreferences.no_animations) { int ix, iy, iw, ih; - if (!wPreferences.disable_miniwindows -#ifdef NETWM_HINTS - && !wwin->flags.net_handle_icon -#endif - ) { + if (!wPreferences.disable_miniwindows && !wwin->flags.net_handle_icon) { ix = wwin->icon_x; iy = wwin->icon_y; iw = wwin->icon->core->width; ih = wwin->icon->core->height; } else { -#ifdef NETWM_HINTS if (wwin->flags.net_handle_icon) { ix = wwin->icon_x; iy = wwin->icon_y; iw = wwin->icon_w; ih = wwin->icon_h; - } else -#endif - { + } else { ix = 0; iy = 0; iw = wwin->screen_ptr->scr_width; @@ -1051,12 +1036,7 @@ void wIconifyWindow(WWindow * wwin) wwin->flags.skip_next_animation = 0; - if (!wPreferences.disable_miniwindows -#ifdef NETWM_HINTS - && !wwin->flags.net_handle_icon -#endif - ) { - + if (!wPreferences.disable_miniwindows && !wwin->flags.net_handle_icon) { if (wwin->screen_ptr->current_workspace == wwin->frame->workspace || IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons) @@ -1110,10 +1090,7 @@ void wIconifyWindow(WWindow * wwin) * it seems to me we might break behaviour this way. */ if (wwin->flags.selected && !wPreferences.disable_miniwindows -#ifdef NETWM_HINTS - && !wwin->flags.net_handle_icon -#endif - ) + && !wwin->flags.net_handle_icon) wIconSelect(wwin->icon); WMPostNotificationName(WMNChangedState, wwin, "iconify"); @@ -1124,13 +1101,9 @@ void wIconifyWindow(WWindow * wwin) void wDeiconifyWindow(WWindow * wwin) { -#ifdef NETWM_HINTS /* we're hiding for show_desktop */ int netwm_hidden = wwin->flags.net_show_desktop && wwin->frame->workspace != wwin->screen_ptr->current_workspace; -#else - int netwm_hidden = False; -#endif if (!netwm_hidden) wWindowChangeWorkspace(wwin, wwin->screen_ptr->current_workspace); @@ -1159,10 +1132,7 @@ void wDeiconifyWindow(WWindow * wwin) /* maybe we want to do this regardless of net_handle_icon * it seems to me we might break behaviour this way. */ - if (!wPreferences.disable_miniwindows -#ifdef NETWM_HINTS - && !wwin->flags.net_handle_icon -#endif + if (!wPreferences.disable_miniwindows && !wwin->flags.net_handle_icon && wwin->icon != NULL) { if (wwin->icon->selected) wIconSelect(wwin->icon); @@ -1179,24 +1149,18 @@ void wDeiconifyWindow(WWindow * wwin) int ix, iy, iw, ih; if (!wPreferences.disable_miniwindows -#ifdef NETWM_HINTS - && !wwin->flags.net_handle_icon -#endif - ) { + && !wwin->flags.net_handle_icon) { ix = wwin->icon_x; iy = wwin->icon_y; iw = wwin->icon->core->width; ih = wwin->icon->core->height; } else { -#ifdef NETWM_HINTS if (wwin->flags.net_handle_icon) { ix = wwin->icon_x; iy = wwin->icon_y; iw = wwin->icon_w; ih = wwin->icon_h; - } else -#endif - { + } else { ix = 0; iy = 0; iw = wwin->screen_ptr->scr_width; @@ -1207,7 +1171,7 @@ void wDeiconifyWindow(WWindow * wwin) wwin->frame_x, wwin->frame_y, wwin->frame->core->width, wwin->frame->core->height); } -#endif /* ANIMATIONS */ +#endif /* ANIMATIONS */ wwin->flags.skip_next_animation = 0; XGrabServer(dpy); if (!wwin->flags.shaded) { @@ -1222,10 +1186,7 @@ void wDeiconifyWindow(WWindow * wwin) } if (!wPreferences.disable_miniwindows && wwin->icon != NULL -#ifdef NETWM_HINTS - && !wwin->flags.net_handle_icon -#endif - ) { + && !wwin->flags.net_handle_icon) { RemoveFromStackList(wwin->icon->core); /* removeIconGrabs(wwin->icon); */ wIconDestroy(wwin->icon); diff --git a/src/application.c b/src/application.c index 91e63c89..b2731f69 100644 --- a/src/application.c +++ b/src/application.c @@ -275,9 +275,7 @@ WApplication *wApplicationCreate(WWindow * wwin) } wapp->main_window_desc->fake_group = wwin->fake_group; -#ifdef NETWM_HINTS wapp->main_window_desc->net_icon_image = RRetainImage(wwin->net_icon_image); -#endif extractIcon(wapp->main_window_desc); diff --git a/src/client.c b/src/client.c index 95dfe269..962e7039 100644 --- a/src/client.c +++ b/src/client.c @@ -43,9 +43,7 @@ #include "stacking.h" #include "appicon.h" #include "appmenu.h" -#ifdef NETWM_HINTS -# include "wmspec.h" -#endif +#include "wmspec.h" /****** Global Variables ******/ @@ -643,9 +641,7 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event) XFree(attr); } else { -#ifdef NETWM_HINTS wNETWMCheckClientHintChange(wwin, event); -#endif } } } diff --git a/src/dialog.c b/src/dialog.c index 530004c4..4fb0790c 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -1604,9 +1604,7 @@ void wShowInfoPanel(WScreen * scr) char buf[80]; int j = 0; -#ifdef NETWM_HINTS list[j++] = "WMSPEC"; -#endif #ifdef MWM_HINTS list[j++] = "MWM"; #endif diff --git a/src/event.c b/src/event.c index 71720b63..b2aeab38 100644 --- a/src/event.c +++ b/src/event.c @@ -56,10 +56,7 @@ #include "properties.h" #include "balloon.h" #include "xinerama.h" - -#ifdef NETWM_HINTS -# include "wmspec.h" -#endif +#include "wmspec.h" /******** Global Variables **********/ extern XContext wWinContext; @@ -1012,10 +1009,8 @@ static void handleClientMessage(XEvent * event) if (!scr) return; scr->flags.ignore_focus_events = event->xclient.data.l[0] ? 1 : 0; -#ifdef NETWM_HINTS } else if (wNETWMProcessClientMessage(&event->xclient)) { /* do nothing */ -#endif #ifdef XDND } else if (wXDNDProcessClientMessage(&event->xclient)) { /* do nothing */ diff --git a/src/icon.c b/src/icon.c index b27e32ff..32202fd5 100644 --- a/src/icon.c +++ b/src/icon.c @@ -155,11 +155,9 @@ WIcon *wIconCreate(WWindow * wwin) #else icon->show_title = 1; #endif -#ifdef NETWM_HINTS if (!icon->image && !WFLAGP(wwin, always_user_icon)) icon->image = RRetainImage(wwin->net_icon_image); if (!icon->image) -#endif icon->image = wDefaultGetImage(scr, wwin->wm_instance, wwin->wm_class); file = wDefaultGetIconFile(scr, wwin->wm_instance, wwin->wm_class, False); @@ -583,11 +581,7 @@ void wIconUpdate(WIcon * icon) XFreePixmap(dpy, icon->pixmap); icon->pixmap = None; - if (wwin && (WFLAGP(wwin, always_user_icon) -#ifdef NETWM_HINTS - || wwin->net_icon_image -#endif - )) + if (wwin && (WFLAGP(wwin, always_user_icon) || wwin->net_icon_image)) goto user_icon; /* use client specified icon window */ diff --git a/src/moveres.c b/src/moveres.c index f6469818..f798064c 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -1532,7 +1532,7 @@ int wKeyboardMoveResizeWindow(WWindow * wwin) wArrangeIcons(scr, True); } -#if defined(NETWM_HINTS) && defined(VIRTUAL_DESKTOP) +#if defined(VIRTUAL_DESKTOP) wWorkspaceResizeViewport(scr, scr->current_workspace); #endif @@ -1803,7 +1803,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev) head != wGetHeadForWindow(wwin)) { wArrangeIcons(scr, True); } -#if defined(NETWM_HINTS) && defined(VIRTUAL_DESKTOP) +#if defined(VIRTUAL_DESKTOP) if (started) wWorkspaceResizeViewport(scr, scr->current_workspace); #endif @@ -2096,7 +2096,7 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev) if (wPreferences.auto_arrange_icons && wXineramaHeads(scr) > 1 && head != wGetHeadForWindow(wwin)) { wArrangeIcons(scr, True); } -#if defined(NETWM_HINTS) && defined(VIRTUAL_DESKTOP) +#if defined(VIRTUAL_DESKTOP) wWorkspaceResizeViewport(scr, scr->current_workspace); #endif } diff --git a/src/screen.c b/src/screen.c index e359dcb1..0819a9fd 100644 --- a/src/screen.c +++ b/src/screen.c @@ -53,9 +53,7 @@ #include "session.h" #include "balloon.h" #include "geomview.h" -#ifdef NETWM_HINTS -# include "wmspec.h" -#endif +#include "wmspec.h" #include "xinerama.h" @@ -704,9 +702,7 @@ WScreen *wScreenInit(int screen_number) createInternalWindows(scr); -#ifdef NETWM_HINTS wNETWMInitStuff(scr); -#endif /* create initial workspace */ wWorkspaceNew(scr); @@ -789,7 +785,7 @@ void wScreenUpdateUsableArea(WScreen * scr) scr->totalUsableArea[i].x1 += offset; } } -#ifdef NETWM_HINTS + { WArea area; if (wNETWMGetUsableArea(scr, i, &area)) { @@ -799,7 +795,6 @@ void wScreenUpdateUsableArea(WScreen * scr) scr->totalUsableArea[i].y2 = WMIN(scr->totalUsableArea[i].y2, area.y2); } } -#endif scr->usableArea[i] = scr->totalUsableArea[i]; @@ -859,13 +854,10 @@ void wScreenUpdateUsableArea(WScreen * scr) } } -#ifdef NETWM_HINTS wNETWMUpdateWorkarea(scr, area); -#endif - if (wPreferences.auto_arrange_icons) { + if (wPreferences.auto_arrange_icons) wArrangeIcons(scr, True); - } } #if 0 diff --git a/src/screen.h b/src/screen.h index 2f0099f0..c37bd5fc 100644 --- a/src/screen.h +++ b/src/screen.h @@ -291,9 +291,7 @@ typedef struct _WScreen { char *xdestring; #endif -#ifdef NETWM_HINTS struct NetData *netdata; -#endif int helper_fd; pid_t helper_pid; diff --git a/src/wconfig.h.in b/src/wconfig.h.in index dffa0923..77ea2177 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -49,8 +49,6 @@ /* #define CPP_PATH @CPP_PATH@ */ -#define NETWM_HINTS - /* support for XDND drop in the Dock. Experimental */ /*#define XDND*/ diff --git a/src/window.c b/src/window.c index 13f828ab..57b51b48 100644 --- a/src/window.c +++ b/src/window.c @@ -59,9 +59,7 @@ #ifdef MWM_HINTS # include "motif.h" #endif -#ifdef NETWM_HINTS -# include "wmspec.h" -#endif +#include "wmspec.h" #define MOD_MASK wPreferences.modifier_mask @@ -245,10 +243,8 @@ void wWindowDestroy(WWindow *wwin) if (wPreferences.auto_arrange_icons) wArrangeIcons(wwin->screen_ptr, True); } -#ifdef NETWM_HINTS if (wwin->net_icon_image) RReleaseImage(wwin->net_icon_image); -#endif wrelease(wwin); } @@ -387,10 +383,8 @@ void wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace) wMWMCheckClientHints(wwin); #endif /* MWM_HINTS */ -#ifdef NETWM_HINTS if (!check) check = wNETWMCheckClientHints(wwin, &tmp_level, &tmp_workspace); -#endif /* window levels are between INT_MIN+1 and INT_MAX, so if we still * have INT_MIN that means that no window level was requested. -Dan @@ -883,9 +877,7 @@ WWindow *wManageWindow(WScreen *scr, Window window) if (WFLAGP(wwin, start_maximized) && IS_RESIZABLE(wwin)) wwin->flags.maximized = MAX_VERTICAL | MAX_HORIZONTAL; -#ifdef NETWM_HINTS wNETWMCheckInitialClientState(wwin); -#endif /* apply previous state if it exists and we're in startup */ if (scr->flags.startup && wm_state >= 0) { @@ -1152,9 +1144,7 @@ WWindow *wManageWindow(WScreen *scr, Window window) wScreenBringInside(scr, &x, &y, width, height); } -#ifdef NETWM_HINTS wNETWMPositionSplash(wwin, &x, &y, width, height); -#endif if (wwin->flags.urgent) { if (!IS_OMNIPRESENT(wwin)) diff --git a/src/window.h b/src/window.h index e5ac7f49..7acfd057 100644 --- a/src/window.h +++ b/src/window.h @@ -300,24 +300,19 @@ typedef struct WWindow { unsigned int user_changed_width:1; unsigned int user_changed_height:1; unsigned int wm_name_changed:1; - -#ifdef NETWM_HINTS unsigned int net_state_from_client:1; /* state hint was set by client */ unsigned int net_skip_pager:1; unsigned int net_handle_icon:1; unsigned int net_show_desktop:1; unsigned int net_has_title:1; /* use netwm version of WM_NAME */ unsigned int net_has_icon_title:1; -#endif } flags; /* state of the window */ struct WIcon *icon; /* icon info for the window */ int icon_x, icon_y; /* position of the icon */ -#ifdef NETWM_HINTS int icon_w, icon_h; RImage *net_icon_image; Atom type; -#endif } WWindow; diff --git a/src/winspector.c b/src/winspector.c index fe473c2f..06328cc0 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -46,11 +46,7 @@ #include "winspector.h" #include "dock.h" #include "client.h" - -#ifdef NETWM_HINTS #include "wmspec.h" -#endif - #include "xinerama.h" #include @@ -828,14 +824,11 @@ static void applySettings(WMButton * button, InspectorPanel * panel) wwin->frame->flags.need_texture_change = 1; wWindowConfigureBorders(wwin); wFrameWindowPaint(wwin->frame); -#ifdef NETWM_HINTS wNETWMUpdateActions(wwin, False); -#endif /* * Can't apply emulate_appicon because it will probably cause problems. */ - if (wapp) { /* do application wide stuff */ WSETUFLAG(wapp->main_window_desc, start_hidden, WMGetButtonSelected(panel->appChk[0])); diff --git a/src/wmspec.c b/src/wmspec.c index 302aa982..988bf44d 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -31,8 +31,6 @@ #include "wconfig.h" -#ifdef NETWM_HINTS - #include #include #include @@ -1646,5 +1644,3 @@ static void wsobserver(void *self, WMNotification * notif) updateWorkspaceNames(scr); } } - -#endif /* NETWM_HINTS */ diff --git a/src/workspace.c b/src/workspace.c index b45d1691..11780705 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -48,10 +48,7 @@ #include "actions.h" #include "workspace.h" #include "appicon.h" -#ifdef NETWM_HINTS #include "wmspec.h" -#endif - #include "xinerama.h" #define MAX_SHORTCUT_LENGTH 32 @@ -122,10 +119,7 @@ int wWorkspaceNew(WScreen * scr) wspace->height = scr->scr_height; wspace->width = scr->scr_width; #endif -#ifdef NETWM_HINTS wNETWMUpdateDesktop(scr); -#endif - WMPostNotificationName(WMNWorkspaceCreated, scr, (void *)(uintptr_t) (scr->workspace_count - 1)); XFlush(dpy); @@ -196,10 +190,7 @@ Bool wWorkspaceDelete(WScreen * scr, int workspace) wMenuRemoveItem(menu, --i); wMenuRealize(menu); } -#ifdef NETWM_HINTS wNETWMUpdateDesktop(scr); -#endif - WMPostNotificationName(WMNWorkspaceDestroyed, scr, (void *)(uintptr_t) (scr->workspace_count - 1)); if (scr->current_workspace >= scr->workspace_count) @@ -616,11 +607,8 @@ void wWorkspaceForceChange(WScreen * scr, int workspace) wClipIconPaint(scr->clip_icon); } } -#ifdef NETWM_HINTS wScreenUpdateUsableArea(scr); wNETWMUpdateDesktop(scr); -#endif - showWorkspaceName(scr, workspace); WMPostNotificationName(WMNWorkspaceChanged, scr, (void *)(uintptr_t) workspace); @@ -1159,9 +1147,7 @@ Bool wWorkspaceSetViewport(WScreen * scr, int workspace, int view_x, int view_y) wptr->view_x = view_x; wptr->view_y = view_y; -#ifdef NETWM_HINTS wNETWMUpdateDesktop(scr); -#endif for (wwin = scr->focused_window; wwin; wwin = wwin->prev) { if (wwin->frame->workspace == workspace && !IS_VSTUCK(wwin)) { -- 2.11.4.GIT