mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Remove #ifdef NETWM_HINTS constructs
NETWM_HINT is always defined in src/wconfig.h.in, so let's remove it from there too.
This commit is contained in:
@@ -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;
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -43,9 +43,7 @@
|
||||
#include "stacking.h"
|
||||
#include "appicon.h"
|
||||
#include "appmenu.h"
|
||||
#ifdef NETWM_HINTS
|
||||
#include "wmspec.h"
|
||||
#endif
|
||||
|
||||
/****** Global Variables ******/
|
||||
|
||||
@@ -643,9 +641,7 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event)
|
||||
|
||||
XFree(attr);
|
||||
} else {
|
||||
#ifdef NETWM_HINTS
|
||||
wNETWMCheckClientHintChange(wwin, event);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -56,10 +56,7 @@
|
||||
#include "properties.h"
|
||||
#include "balloon.h"
|
||||
#include "xinerama.h"
|
||||
|
||||
#ifdef NETWM_HINTS
|
||||
#include "wmspec.h"
|
||||
#endif
|
||||
|
||||
/******** 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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
12
src/screen.c
12
src/screen.c
@@ -53,9 +53,7 @@
|
||||
#include "session.h"
|
||||
#include "balloon.h"
|
||||
#include "geomview.h"
|
||||
#ifdef NETWM_HINTS
|
||||
#include "wmspec.h"
|
||||
#endif
|
||||
|
||||
#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,14 +854,11 @@ 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
|
||||
void wScreenUpdateUsableArea(WScreen * scr)
|
||||
|
||||
@@ -291,9 +291,7 @@ typedef struct _WScreen {
|
||||
char *xdestring;
|
||||
#endif
|
||||
|
||||
#ifdef NETWM_HINTS
|
||||
struct NetData *netdata;
|
||||
#endif
|
||||
|
||||
int helper_fd;
|
||||
pid_t helper_pid;
|
||||
|
||||
@@ -49,8 +49,6 @@
|
||||
|
||||
/* #define CPP_PATH @CPP_PATH@ */
|
||||
|
||||
#define NETWM_HINTS
|
||||
|
||||
/* support for XDND drop in the Dock. Experimental */
|
||||
/*#define XDND*/
|
||||
|
||||
|
||||
10
src/window.c
10
src/window.c
@@ -59,9 +59,7 @@
|
||||
#ifdef MWM_HINTS
|
||||
# include "motif.h"
|
||||
#endif
|
||||
#ifdef NETWM_HINTS
|
||||
#include "wmspec.h"
|
||||
#endif
|
||||
|
||||
#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))
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -46,11 +46,7 @@
|
||||
#include "winspector.h"
|
||||
#include "dock.h"
|
||||
#include "client.h"
|
||||
|
||||
#ifdef NETWM_HINTS
|
||||
#include "wmspec.h"
|
||||
#endif
|
||||
|
||||
#include "xinerama.h"
|
||||
|
||||
#include <WINGs/WUtil.h>
|
||||
@@ -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]));
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
|
||||
#include "wconfig.h"
|
||||
|
||||
#ifdef NETWM_HINTS
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xarch.h>
|
||||
@@ -1646,5 +1644,3 @@ static void wsobserver(void *self, WMNotification * notif)
|
||||
updateWorkspaceNames(scr);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* NETWM_HINTS */
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user