1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-26 08:22:37 +01:00

- Removed support for legacy systems: OpenLook, KDE-2.x, Gnome-1.x

- Removed #define and #ifdef XFT constructs, as XFT is on all the time
This commit is contained in:
dan
2004-10-14 23:05:20 +00:00
parent 884a3f1647
commit 0c09179f01
49 changed files with 72 additions and 4593 deletions

View File

@@ -38,14 +38,10 @@ wmaker_SOURCES = \
framewin.h \
geomview.c \
geomview.h \
gnome.c \
gnome.h \
funcs.h \
icon.c \
icon.h \
keybind.h \
kwm.h \
kwm.c \
main.c \
menu.c \
menu.h \
@@ -54,8 +50,6 @@ wmaker_SOURCES = \
motif.c \
motif.h \
moveres.c \
openlook.c \
openlook.h \
pixmap.c \
pixmap.h \
placement.c \

View File

@@ -50,14 +50,6 @@
#include "wsound.h"
#include "xinerama.h"
#ifdef GNOME_STUFF
# include "gnome.h"
#endif
#ifdef KWM_HINTS
# include "kwm.h"
#endif
/****** Global Variables ******/
extern Time LastTimestamp;
@@ -434,10 +426,6 @@ wMaximizeWindow(WWindow *wwin, int directions)
}
wwin->flags.maximized = directions;
#ifdef KWM_HINTS
wKWMUpdateClientGeometryRestore(wwin);
#endif
if (directions & MAX_HORIZONTAL) {
new_width = (usableArea.x2-usableArea.x1)-FRAME_BORDER_WIDTH*2;
new_x = usableArea.x1;
@@ -1014,30 +1002,20 @@ wIconifyWindow(WWindow *wwin)
iw = wwin->icon->core->width;
ih = wwin->icon->core->height;
} else {
#ifdef KWM_HINTS
WArea area;
if (wKWMGetIconGeometry(wwin, &area)) {
ix = area.x1;
iy = area.y1;
iw = area.x2 - ix;
ih = area.y2 - iy;
} else
#endif /* KWM_HINTS */
#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
if (wwin->flags.net_handle_icon) {
ix = wwin->icon_x;
iy = wwin->icon_y;
iw = wwin->icon_w;
ih = wwin->icon_h;
} else
#endif
{
ix = 0;
iy = 0;
iw = wwin->screen_ptr->scr_width;
ih = wwin->screen_ptr->scr_height;
}
{
ix = 0;
iy = 0;
iw = wwin->screen_ptr->scr_width;
ih = wwin->screen_ptr->scr_height;
}
}
animateResize(wwin->screen_ptr, wwin->frame_x, wwin->frame_y,
wwin->frame->core->width, wwin->frame->core->height,
@@ -1192,30 +1170,20 @@ wDeiconifyWindow(WWindow *wwin)
iw = wwin->icon->core->width;
ih = wwin->icon->core->height;
} else {
#ifdef KWM_HINTS
WArea area;
if (wKWMGetIconGeometry(wwin, &area)) {
ix = area.x1;
iy = area.y1;
iw = area.x2 - ix;
ih = area.y2 - iy;
} else
#endif /* KWM_HINTS */
#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
if (wwin->flags.net_handle_icon) {
ix = wwin->icon_x;
iy = wwin->icon_y;
iw = wwin->icon_w;
ih = wwin->icon_h;
} else
#endif
{
ix = 0;
iy = 0;
iw = wwin->screen_ptr->scr_width;
ih = wwin->screen_ptr->scr_height;
}
{
ix = 0;
iy = 0;
iw = wwin->screen_ptr->scr_width;
ih = wwin->screen_ptr->scr_height;
}
}
animateResize(wwin->screen_ptr, ix, iy, iw, ih,
wwin->frame_x, wwin->frame_y,

View File

@@ -43,9 +43,6 @@
#include "stacking.h"
#include "appicon.h"
#include "appmenu.h"
#ifdef KWM_HINTS
#include "kwm.h"
#endif
#ifdef NETWM_HINTS
# include "wmspec.h"
#endif
@@ -339,9 +336,6 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
break;
case XA_WM_ICON_NAME:
#ifdef KWM_HINTS
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
if (!wwin->icon)
break;
else {
@@ -504,9 +498,6 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
if (wapp && wapp->app_icon) {
wIconUpdate(wapp->app_icon->icon);
}
#ifdef KWM_HINTS
wKWMSendEventMessage(wwin, WKWMIconChange);
#endif
}
if (wwin->wm_hints->flags & UrgencyHint)
@@ -663,17 +654,8 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
XFree(attr);
} else {
#if defined(KWM_HINTS) || defined(NETWM_HINTS)
Bool done = False;
#endif
#ifdef KWM_HINTS
if (!done)
done = wKWMCheckClientHintChange(wwin, event);
#endif /* KWM_HINTS */
#ifdef NETWM_HINTS
if (!done) {
done = wNETWMCheckClientHintChange(wwin, event);
}
wNETWMCheckClientHintChange(wwin, event);
#endif
}
}

View File

@@ -1370,21 +1370,12 @@ wShowInfoPanel(WScreen *scr)
char buf[80];
int j = 0;
#ifdef MWM_HINTS
list[j++] = "MWM";
#endif
#ifdef KWM_HINTS
list[j++] = "KDE";
#endif
#ifdef GNOME_STUFF
list[j++] = "GNOME";
#endif
#ifdef OLWM_HINTS
list[j++] = "OLWM";
#endif
#ifdef NETWM_HINTS
list[j++] = "WMSPEC";
#endif
#ifdef MWM_HINTS
list[j++] = "MWM";
#endif
buf[0] = 0;
for (i = 0; i < j; i++) {
@@ -1405,12 +1396,10 @@ wShowInfoPanel(WScreen *scr)
strbuf = wstrappend(strbuf, _("\nSound enabled"));
}
#ifdef XFT
strbuf = wstrappend(strbuf, _("; Antialiased text"));
#endif
#ifdef VIRTUAL_DESKTOP
strbuf = wstrappend(strbuf, _("; VirtualDesktop"));
strbuf = wstrappend(strbuf, _(", VirtualDesktop"));
#endif
#ifdef XINERAMA

View File

@@ -60,12 +60,6 @@
#include "balloon.h"
#include "xinerama.h"
#ifdef GNOME_STUFF
# include "gnome.h"
#endif
#ifdef KWM_HINTS
# include "kwm.h"
#endif
#ifdef NETWM_HINTS
# include "wmspec.h"
#endif
@@ -627,10 +621,6 @@ handleDestroyNotify(XEvent *event)
}
wApplicationDestroy(app);
}
#ifdef KWM_HINTS
wKWMCheckDestroy(&event->xdestroywindow);
#endif
}
@@ -724,10 +714,6 @@ handleButtonPress(XEvent *event)
wPreferences.mouse_wheel!=WA_NONE) {
wWorkspaceRelativeChange(scr, -1);
}
#ifdef GNOME_STUFF
else if (wGNOMEProxyizeButtonEvent(scr, event))
return;
#endif
}
#endif /* !LITE */
@@ -897,11 +883,6 @@ handlePropertyNotify(XEvent *event)
}
scr = wScreenForWindow(event->xproperty.window);
if (scr && scr->root_win == event->xproperty.window) {
#ifdef KWM_HINTS
wKWMCheckRootHintChange(scr, &event->xproperty);
#endif
}
}
@@ -1001,14 +982,6 @@ handleClientMessage(XEvent *event)
} else if (wNETWMProcessClientMessage(&event->xclient)) {
/* do nothing */
#endif
#ifdef GNOME_STUFF
} else if (wGNOMEProcessClientMessage(&event->xclient)) {
/* do nothing */
#endif /* GNOME_STUFF */
#ifdef KWM_HINTS
} else if (wKWMProcessClientMessage(&event->xclient)) {
/* do nothing */
#endif /* KWM_HINTS */
#ifdef XDND
} else if (wXDNDProcessClientMessage(&event->xclient)) {
/* do nothing */

View File

@@ -1272,19 +1272,6 @@ wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title)
}
#ifdef OLWM_HINTS
void
wFrameWindowUpdatePushButton(WFrameWindow *fwin, Bool pushed)
{
fwin->flags.right_button_pushed_in = pushed;
paintButton(fwin->right_button, fwin->title_texture[fwin->flags.state],
WMColorPixel(fwin->title_color[fwin->flags.state]),
fwin->rbutton_image, pushed);
}
#endif /* OLWM_HINTS */
#ifdef XKB_BUTTON_HINT
void
wFrameWindowUpdateLanguageButton(WFrameWindow *fwin)
@@ -1467,16 +1454,9 @@ handleButtonExpose(WObjDescriptor *desc, XEvent *event)
WMColorPixel(fwin->title_color[fwin->flags.state]),
fwin->lbutton_image, False);
} else {
Bool pushed = False;
#ifdef OLWM_HINTS
if (fwin->flags.right_button_pushed_in)
pushed = True;
#endif
/* emulate the olwm pushpin in the "out" state */
paintButton(button, fwin->title_texture[fwin->flags.state],
WMColorPixel(fwin->title_color[fwin->flags.state]),
fwin->rbutton_image, pushed);
fwin->rbutton_image, False);
}
}

View File

@@ -143,10 +143,6 @@ typedef struct WFrameWindow {
unsigned int is_client_window_frame:1;
unsigned int incomplete_title:1;
#ifdef OLWM_HINTS
unsigned int right_button_pushed_in:1;
#endif
} flags;
} WFrameWindow;
@@ -176,10 +172,6 @@ void wFrameWindowHideButton(WFrameWindow *fwin, int flags);
int wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title);
#ifdef OLWM_HINTS
void wFrameWindowUpdatePushButton(WFrameWindow *fwin, Bool pushed);
#endif
#ifdef XKB_BUTTON_HINT
void wFrameWindowUpdateLanguageButton(WFrameWindow *fwin);
#endif

View File

@@ -1,731 +0,0 @@
/* gnome.c-- support for the GNOME Hints
*
* Window Maker window manager
*
* Copyright (c) 1998-2003 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
/*
* According to the author of this thing, it should not be taken seriously.
* IMHO, there are lot's of weirdnesses and it's quite unelegant. I'd
* rather not support it, but here it goes anyway.
*/
#include "wconfig.h"
#ifdef GNOME_STUFF
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "WindowMaker.h"
#include "screen.h"
#include "wcore.h"
#include "framewin.h"
#include "window.h"
#include "workspace.h"
#include "funcs.h"
#include "actions.h"
#include "stacking.h"
#include "client.h"
#include "xinerama.h"
#include "gnome.h"
#define WIN_HINTS_SKIP_FOCUS (1<<0) /*"alt-tab" skips this win*/
#define WIN_HINTS_SKIP_WINLIST (1<<1) /*do not show in window list*/
#define WIN_HINTS_SKIP_TASKBAR (1<<2) /*do not show on taskbar*/
#define WIN_HINTS_GROUP_TRANSIENT (1<<3) /*Reserved - definition is unclear*/
#define WIN_HINTS_FOCUS_ON_CLICK (1<<4) /*app only accepts focus if clicked*/
#define WIN_HINTS_DO_NOT_COVER (1<<5) /* attempt to not cover this window */
#define WIN_STATE_STICKY (1<<0) /*everyone knows sticky*/
#define WIN_STATE_MINIMIZED (1<<1) /*Reserved - definition is unclear*/
#define WIN_STATE_MAXIMIZED_VERT (1<<2) /*window in maximized V state*/
#define WIN_STATE_MAXIMIZED_HORIZ (1<<3) /*window in maximized H state*/
#define WIN_STATE_HIDDEN (1<<4) /*not on taskbar but window visible*/
#define WIN_STATE_SHADED (1<<5) /*shaded (MacOS / Afterstep style)*/
/* these are bogus states defined in "the spec" */
#define WIN_STATE_HID_WORKSPACE (1<<6) /*not on current desktop*/
#define WIN_STATE_HID_TRANSIENT (1<<7) /*owner of transient is hidden*/
#define WIN_STATE_FIXED_POSITION (1<<8) /*window is fixed in position even*/
#define WIN_STATE_ARRANGE_IGNORE (1<<9) /*ignore for auto arranging*/
#define WIN_LAYER_DESKTOP 0
#define WIN_LAYER_BELOW 2
#define WIN_LAYER_NORMAL 4
#define WIN_LAYER_ONTOP 6
#define WIN_LAYER_DOCK 8
#define WIN_LAYER_ABOVE_DOCK 10
#define WIN_LAYER_MENU 12
static Atom _XA_WIN_SUPPORTING_WM_CHECK = 0;
static Atom _XA_WIN_PROTOCOLS;
static Atom _XA_WIN_LAYER;
static Atom _XA_WIN_STATE;
static Atom _XA_WIN_HINTS;
static Atom _XA_WIN_APP_STATE;
static Atom _XA_WIN_EXPANDED_SIZE;
static Atom _XA_WIN_ICONS;
static Atom _XA_WIN_WORKSPACE;
static Atom _XA_WIN_WORKSPACE_COUNT;
static Atom _XA_WIN_WORKSPACE_NAMES;
static Atom _XA_WIN_CLIENT_LIST;
static Atom _XA_WIN_DESKTOP_BUTTON_PROXY;
static void observer(void *self, WMNotification *notif);
static void wsobserver(void *self, WMNotification *notif);
void
wGNOMEInitStuff(WScreen *scr)
{
Atom supportedStuff[10];
int count;
if (!_XA_WIN_SUPPORTING_WM_CHECK) {
_XA_WIN_SUPPORTING_WM_CHECK =
XInternAtom(dpy, "_WIN_SUPPORTING_WM_CHECK", False);
_XA_WIN_PROTOCOLS = XInternAtom(dpy, "_WIN_PROTOCOLS", False);
_XA_WIN_LAYER = XInternAtom(dpy, "_WIN_LAYER", False);
_XA_WIN_STATE = XInternAtom(dpy, "_WIN_STATE", False);
_XA_WIN_HINTS = XInternAtom(dpy, "_WIN_HINTS", False);
_XA_WIN_APP_STATE = XInternAtom(dpy, "_WIN_APP_STATE", False);
_XA_WIN_EXPANDED_SIZE = XInternAtom(dpy, "_WIN_EXPANDED_SIZE", False);
_XA_WIN_ICONS = XInternAtom(dpy, "_WIN_ICONS", False);
_XA_WIN_WORKSPACE = XInternAtom(dpy, "_WIN_WORKSPACE", False);
_XA_WIN_WORKSPACE_COUNT =
XInternAtom(dpy, "_WIN_WORKSPACE_COUNT", False);
_XA_WIN_WORKSPACE_NAMES =
XInternAtom(dpy, "_WIN_WORKSPACE_NAMES", False);
_XA_WIN_CLIENT_LIST = XInternAtom(dpy, "_WIN_CLIENT_LIST", False);
_XA_WIN_DESKTOP_BUTTON_PROXY =
XInternAtom(dpy, "_WIN_DESKTOP_BUTTON_PROXY", False);
}
/* I'd rather use the ICCCM 2.0 mechanisms, but
* since some people prefer to reinvent the wheel instead of
* conforming to standards... */
/* setup the "We're compliant, you idiot!" hint */
/* why XA_CARDINAL instead of XA_WINDOW? */
XChangeProperty(dpy, scr->root_win, _XA_WIN_SUPPORTING_WM_CHECK,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char*)&scr->no_focus_win, 1);
XChangeProperty(dpy, scr->no_focus_win, _XA_WIN_SUPPORTING_WM_CHECK,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char*)&scr->no_focus_win, 1);
/* setup the "desktop button proxy" thing */
XChangeProperty(dpy, scr->root_win, _XA_WIN_DESKTOP_BUTTON_PROXY,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char*)&scr->no_focus_win, 1);
XChangeProperty(dpy, scr->no_focus_win, _XA_WIN_DESKTOP_BUTTON_PROXY,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char*)&scr->no_focus_win, 1);
/* setup the list of supported protocols */
count = 0;
supportedStuff[count++] = _XA_WIN_LAYER;
supportedStuff[count++] = _XA_WIN_STATE;
supportedStuff[count++] = _XA_WIN_HINTS;
supportedStuff[count++] = _XA_WIN_APP_STATE;
supportedStuff[count++] = _XA_WIN_EXPANDED_SIZE;
supportedStuff[count++] = _XA_WIN_ICONS;
supportedStuff[count++] = _XA_WIN_WORKSPACE;
supportedStuff[count++] = _XA_WIN_WORKSPACE_COUNT;
supportedStuff[count++] = _XA_WIN_WORKSPACE_NAMES;
supportedStuff[count++] = _XA_WIN_CLIENT_LIST;
XChangeProperty(dpy, scr->root_win, _XA_WIN_PROTOCOLS, XA_ATOM, 32,
PropModeReplace, (unsigned char*)supportedStuff, count);
XFlush(dpy);
WMAddNotificationObserver(observer, NULL, WMNManaged, NULL);
WMAddNotificationObserver(observer, NULL, WMNUnmanaged, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedWorkspace, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedState, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedFocus, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedStacking, NULL);
WMAddNotificationObserver(observer, NULL, WMNChangedName, NULL);
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceCreated, NULL);
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceDestroyed, NULL);
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceChanged, NULL);
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceNameChanged, NULL);
}
void
wGNOMEUpdateClientListHint(WScreen *scr)
{
WWindow *wwin;
Window *windows;
int count;
windows = malloc(sizeof(Window)*scr->window_count);
if (!windows) {
wwarning(_("out of memory while updating GNOME hints"));
return;
}
count = 0;
wwin = scr->focused_window;
while (wwin) {
if (!wwin->flags.internal_window &&
!wwin->client_flags.skip_window_list) {
windows[count++] = wwin->client_win;
}
wwin = wwin->prev;
}
XChangeProperty(dpy, scr->root_win, _XA_WIN_CLIENT_LIST, XA_CARDINAL, 32,
PropModeReplace, (unsigned char *)windows, count);
wfree(windows);
XFlush(dpy);
}
void
wGNOMEUpdateWorkspaceHints(WScreen *scr)
{
long val;
val = scr->workspace_count;
XChangeProperty(dpy, scr->root_win, _XA_WIN_WORKSPACE_COUNT, XA_CARDINAL,
32, PropModeReplace, (unsigned char*)&val, 1);
wGNOMEUpdateWorkspaceNamesHint(scr);
}
void
wGNOMEUpdateWorkspaceNamesHint(WScreen *scr)
{
char *wsNames[MAX_WORKSPACES];
XTextProperty textProp;
int i;
for (i = 0; i < scr->workspace_count; i++) {
wsNames[i] = scr->workspaces[i]->name;
}
if (XStringListToTextProperty(wsNames, scr->workspace_count, &textProp)) {
XSetTextProperty(dpy, scr->root_win, &textProp,
_XA_WIN_WORKSPACE_NAMES);
XFree(textProp.value);
}
}
void
wGNOMEUpdateCurrentWorkspaceHint(WScreen *scr)
{
long val;
val = scr->current_workspace;
XChangeProperty(dpy, scr->root_win, _XA_WIN_WORKSPACE, XA_CARDINAL,
32, PropModeReplace, (unsigned char*)&val, 1);
}
static int
getWindowLevel(int layer)
{
int level;
if (layer <= WIN_LAYER_DESKTOP)
level = WMDesktopLevel;
else if (layer <= WIN_LAYER_BELOW)
level = WMSunkenLevel;
else if (layer <= WIN_LAYER_NORMAL)
level = WMNormalLevel;
else if (layer <= WIN_LAYER_ONTOP)
level = WMFloatingLevel;
else if (layer <= WIN_LAYER_DOCK)
level = WMDockLevel;
else if (layer <= WIN_LAYER_ABOVE_DOCK)
level = WMSubmenuLevel;
else if (layer <= WIN_LAYER_MENU)
level = WMMainMenuLevel;
else
level = WMOuterSpaceLevel;
return level;
}
Bool
wGNOMECheckClientHints(WWindow *wwin, int *layer, int *workspace)
{
Atom type_ret;
int fmt_ret;
unsigned long nitems_ret;
unsigned long bytes_after_ret;
long flags, val, *data = 0;
Bool hasHints = False;
/* hints */
if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_HINTS, 0, 1, False,
/* should be XA_INTEGER, but spec is broken */
XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret,
&bytes_after_ret,
(unsigned char**)&data)==Success && data) {
flags = *data;
XFree(data);
if (flags & (WIN_HINTS_SKIP_FOCUS|WIN_HINTS_SKIP_WINLIST
|WIN_HINTS_SKIP_TASKBAR)) {
wwin->client_flags.skip_window_list = 1;
}
/* client reserved area, for the panel */
if (flags & (WIN_HINTS_DO_NOT_COVER)) {
WReservedArea *area;
area = malloc(sizeof(WReservedArea));
if (!area) {
wwarning(_("out of memory while updating GNOME hints"));
} else {
XWindowAttributes wattribs;
XGetWindowAttributes(dpy, wwin->client_win, &wattribs);
wClientGetNormalHints(wwin, &wattribs, False,
&area->area.x1, &area->area.y1,
&area->area.x2, &area->area.y2);
area->area.x2 = area->area.x2 + area->area.x1;
area->area.y2 = area->area.y2 + area->area.y1;
area->window = wwin->client_win;
}
area->next = wwin->screen_ptr->reservedAreas;
wwin->screen_ptr->reservedAreas = area;
wScreenUpdateUsableArea(wwin->screen_ptr);
}
hasHints = True;
}
/* layer */
if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_LAYER, 0, 1, False,
XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret,
&bytes_after_ret,
(unsigned char**)&data)==Success && data) {
val = *data;
XFree(data);
*layer = getWindowLevel(val);
hasHints = True;
}
/* workspace */
if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_WORKSPACE, 0, 1,
False, XA_CARDINAL, &type_ret, &fmt_ret,
&nitems_ret, &bytes_after_ret,
(unsigned char**)&data)==Success && data) {
val = *data;
XFree(data);
if (val > 0)
*workspace = val;
hasHints = True;
}
/* reserved area */
if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_EXPANDED_SIZE, 0, 1,
False, XA_CARDINAL, &type_ret, &fmt_ret,
&nitems_ret, &bytes_after_ret,
(unsigned char**)&data)==Success && data) {
WReservedArea *area;
area = malloc(sizeof(WReservedArea));
if (!area) {
wwarning(_("out of memory while updating GNOME hints"));
} else {
area->area.x1 = data[0];
area->area.y1 = data[1];
area->area.x2 = data[2] - data[0];
area->area.y2 = data[3] - data[1];
XFree(data);
area->window = wwin->client_win;
}
area->next = wwin->screen_ptr->reservedAreas;
wwin->screen_ptr->reservedAreas = area;
wScreenUpdateUsableArea(wwin->screen_ptr);
hasHints = True;
}
return hasHints;
}
Bool
wGNOMEGetUsableArea(WScreen *scr, int head, WArea *area)
{
WReservedArea *cur;
WMRect rect;
if(!scr->reservedAreas)
return False;
area->x1 = area->y1 = area->x2 = area->y2 = 0;
for(cur = scr->reservedAreas ; cur ; cur = cur->next) {
WWindow * wwin = wWindowFor(cur->window);
if (wWindowTouchesHead(wwin, head)) {
if(cur->area.x1 > area->x1)
area->x1 = cur->area.x1;
if(cur->area.y1 > area->y1)
area->y1 = cur->area.y1;
if(cur->area.x2 > area->x2)
area->x2 = cur->area.x2;
if(cur->area.y2 > area->y2)
area->y2 = cur->area.y2;
}
}
if (area->x1==0 && area->x2==0 &&
area->y1==0 && area->y2==0) return False;
rect = wGetRectForHead(scr, head);
area->x1 = rect.pos.x + area->x1;
area->x2 = rect.pos.x + rect.size.width - area->x2;
area->y1 = rect.pos.y + area->y1;
area->y2 = rect.pos.y + rect.size.height - area->y2;
return True;
}
Bool
wGNOMECheckInitialClientState(WWindow *wwin)
{
Atom type_ret;
int fmt_ret;
unsigned long nitems_ret;
unsigned long bytes_after_ret;
long flags, *data = 0;
if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_STATE, 0, 1, False,
XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret,
&bytes_after_ret,
(unsigned char**)&data)!=Success || !data)
return False;
flags = *data;
XFree(data);
if (flags & WIN_STATE_STICKY)
wwin->client_flags.omnipresent = 1;
if (flags & (WIN_STATE_MAXIMIZED_VERT|WIN_STATE_MAXIMIZED_HORIZ)) {
if (flags & WIN_STATE_MAXIMIZED_VERT)
wwin->flags.maximized |= MAX_VERTICAL;
if (flags & WIN_STATE_MAXIMIZED_HORIZ)
wwin->flags.maximized |= MAX_HORIZONTAL;
}
if (flags & WIN_STATE_SHADED)
wwin->flags.shaded = 1;
return True;
}
void
wGNOMEUpdateClientStateHint(WWindow *wwin, Bool changedWorkspace)
{
long val;
long flags = 0;
if (changedWorkspace) {
val = wwin->frame->workspace;
XChangeProperty(dpy, wwin->client_win, _XA_WIN_WORKSPACE, XA_CARDINAL,
32, PropModeReplace, (unsigned char*)&val, 1);
if (val != wwin->screen_ptr->current_workspace)
flags |= WIN_STATE_HID_WORKSPACE;
}
if (IS_OMNIPRESENT(wwin))
flags |= WIN_STATE_STICKY;
if (wwin->flags.miniaturized)
flags |= WIN_STATE_MINIMIZED;
if (wwin->flags.maximized & MAX_VERTICAL)
flags |= WIN_STATE_MAXIMIZED_VERT;
if (wwin->flags.maximized & MAX_HORIZONTAL)
flags |= WIN_STATE_MAXIMIZED_HORIZ;
if (wwin->flags.shaded)
flags |= WIN_STATE_SHADED;
if (wwin->transient_for != None) {
WWindow *owner = wWindowFor(wwin->transient_for);
if (owner && !owner->flags.mapped)
flags |= WIN_STATE_HID_TRANSIENT;
}
/* ? */
if (wwin->flags.hidden)
flags |= WIN_STATE_HIDDEN;
XChangeProperty(dpy, wwin->client_win, _XA_WIN_STATE, XA_CARDINAL,
32, PropModeReplace, (unsigned char*)&flags, 1);
}
Bool
wGNOMEProcessClientMessage(XClientMessageEvent *event)
{
WScreen *scr;
WWindow *wwin;
Bool done = True;
scr = wScreenForWindow(event->window);
if (scr) {
/* generic client messages */
if (event->message_type == _XA_WIN_WORKSPACE) {
wWorkspaceChange(scr, event->data.l[0]);
} else {
done = False;
}
if (done)
return True;
}
/* window specific client messages */
wwin = wWindowFor(event->window);
if (!wwin)
return False;
if (event->message_type == _XA_WIN_LAYER) {
int level = getWindowLevel(event->data.l[0]);
if (WINDOW_LEVEL(wwin) != level) {
ChangeStackingLevel(wwin->frame->core, level);
}
} else if (event->message_type == _XA_WIN_STATE) {
int flags, mask;
int maximize = 0;
mask = event->data.l[0];
flags = event->data.l[1];
if (mask & WIN_STATE_STICKY) {
if ((flags & WIN_STATE_STICKY) != WFLAGP(wwin, omnipresent)) {
wWindowSetOmnipresent(wwin, (flags & WIN_STATE_STICKY)!=0);
}
}
if (mask & WIN_STATE_MAXIMIZED_VERT) {
if (flags & WIN_STATE_MAXIMIZED_VERT)
maximize = MAX_VERTICAL;
else
maximize = 0;
} else {
maximize = wwin->flags.maximized & MAX_VERTICAL;
}
if (mask & WIN_STATE_MAXIMIZED_HORIZ) {
if (flags & WIN_STATE_MAXIMIZED_HORIZ)
maximize |= MAX_HORIZONTAL;
else
maximize |= 0;
} else {
maximize |= wwin->flags.maximized & MAX_HORIZONTAL;
}
if (maximize != wwin->flags.maximized) {
if (maximize) {
wMaximizeWindow(wwin, maximize);
} else {
wUnmaximizeWindow(wwin);
}
}
if (mask & WIN_STATE_SHADED) {
if ((flags & WIN_STATE_SHADED) != wwin->flags.shaded) {
if (wwin->flags.shaded)
wUnshadeWindow(wwin);
else
wShadeWindow(wwin);
}
}
} else if (event->message_type == _XA_WIN_WORKSPACE) {
if (event->data.l[0] != wwin->frame->workspace) {
wWindowChangeWorkspace(wwin, event->data.l[0]);
}
} else {
done = False;
}
return done;
}
Bool
wGNOMEProxyizeButtonEvent(WScreen *scr, XEvent *event)
{
if (event->type == ButtonPress)
XUngrabPointer(dpy, CurrentTime);
XSendEvent(dpy, scr->no_focus_win, False, SubstructureNotifyMask, event);
return True;
}
void
wGNOMERemoveClient(WWindow *wwin)
{
int flag = 0;
WReservedArea *area;
wGNOMEUpdateClientListHint(wwin->screen_ptr);
area = wwin->screen_ptr->reservedAreas;
if (area) {
if (area->window == wwin->client_win) {
wwin->screen_ptr->reservedAreas = area->next;
wfree(area);
flag = 1;
} else {
while (area->next && area->next->window != wwin->client_win)
area = area->next;
if (area->next) {
WReservedArea *next;
next = area->next->next;
wfree(area->next);
area->next = next;
flag = 1;
}
}
}
if (flag) {
wScreenUpdateUsableArea(wwin->screen_ptr);
}
}
static void
observer(void *self, WMNotification *notif)
{
WWindow *wwin = (WWindow*)WMGetNotificationObject(notif);
const char *name = WMGetNotificationName(notif);
if (strcmp(name, WMNManaged) == 0 && wwin) {
wGNOMEUpdateClientStateHint(wwin, True);
wGNOMEUpdateClientListHint(wwin->screen_ptr);
} else if (strcmp(name, WMNUnmanaged) == 0 && wwin) {
wGNOMERemoveClient(wwin);
} else if (strcmp(name, WMNChangedWorkspace) == 0 && wwin) {
wGNOMEUpdateClientStateHint(wwin, True);
} else if (strcmp(name, WMNChangedState) == 0 && wwin) {
wGNOMEUpdateClientStateHint(wwin, False);
}
}
static void
wsobserver(void *self, WMNotification *notif)
{
WScreen *scr = (WScreen*)WMGetNotificationObject(notif);
const char *name = WMGetNotificationName(notif);
if (strcmp(name, WMNWorkspaceCreated) == 0) {
wGNOMEUpdateWorkspaceHints(scr);
} else if (strcmp(name, WMNWorkspaceDestroyed) == 0) {
wGNOMEUpdateWorkspaceHints(scr);
} else if (strcmp(name, WMNWorkspaceNameChanged) == 0) {
wGNOMEUpdateWorkspaceNamesHint(scr);
} else if (strcmp(name, WMNWorkspaceChanged) == 0) {
wGNOMEUpdateCurrentWorkspaceHint(scr);
} else if (strcmp(name, WMNResetStacking) == 0) {
}
}
#endif /* GNOME_STUFF */

View File

@@ -1,53 +0,0 @@
/* gnome.h-- stuff for support for gnome hints
*
* Window Maker window manager
*
* Copyright (c) 1998-2003 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#ifndef _GNOME_H_
#define _GNOME_H_
void wGNOMEInitStuff(WScreen *scr);
void wGNOMEUpdateClientListHint(WScreen *scr);
void wGNOMEUpdateWorkspaceHints(WScreen *scr);
void wGNOMEUpdateCurrentWorkspaceHint(WScreen *scr);
void wGNOMEUpdateWorkspaceNamesHint(WScreen *scr);
Bool wGNOMECheckClientHints(WWindow *wwin, int *layer, int *workspace);
void wGNOMEUpdateClientStateHint(WWindow *wwin, Bool changedWorkspace);
Bool wGNOMEProcessClientMessage(XClientMessageEvent *event);
void wGNOMERemoveClient(WWindow *wwin);
Bool wGNOMECheckInitialClientState(WWindow *wwin);
Bool wGNOMEProxyizeButtonEvent(WScreen *scr, XEvent *event);
Bool wGNOMEGetUsableArea(WScreen *scr, int head, WArea *area);
#endif

1955
src/kwm.c

File diff suppressed because it is too large Load Diff

102
src/kwm.h
View File

@@ -1,102 +0,0 @@
/* kde.h-- stuff for support for kde hints
*
* Window Maker window manager
*
* Copyright (c) 1998-2003 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#ifndef _KWM_H_
#define _KWM_H_
typedef enum {
KWMStickyFlag = (1<<0),
KWMMaximizedFlag = (1<<1),
KWMIconifiedFlag = (1<<2),
KWMAllFlags = 7
} WKWMStateFlag;
typedef enum {
WKWMAddWindow,
WKWMRemoveWindow,
WKWMFocusWindow,
WKWMRaiseWindow,
WKWMLowerWindow,
WKWMChangedClient,
WKWMIconChange
} WKWMEventMessage;
void wKWMInitStuff(WScreen *scr);
Bool wKWMGetUsableArea(WScreen *scr, int head, WArea *area);
Bool wKWMCheckClientHints(WWindow *wwin, int *layer, int *workspace);
Bool wKWMCheckClientHintChange(WWindow *wwin, XPropertyEvent *event);
Bool wKWMCheckRootHintChange(WScreen *scr, XPropertyEvent *event);
void wKWMUpdateWorkspaceCountHint(WScreen *scr);
void wKWMUpdateWorkspaceNameHint(WScreen *scr, int workspace);
void wKWMUpdateCurrentWorkspaceHint(WScreen *scr);
Bool wKWMProcessClientMessage(XClientMessageEvent *event);
void wKWMUpdateClientGeometryRestore(WWindow *wwin);
void wKWMUpdateClientWorkspace(WWindow *wwin);
void wKWMUpdateClientStateHint(WWindow *wwin, WKWMStateFlag flags);
Bool wKWMManageableClient(WScreen *scr, Window win, char *title);
Bool wKWMCheckClientInitialState(WWindow *wwin);
#ifdef not_used
void wKWMSetUsableAreaHint(WScreen *scr, int workspace);
#endif
void wKWMSetInitializedHint(WScreen *scr);
void wKWMShutdown(WScreen *scr, Bool closeModules);
void wKWMCheckModule(WScreen *scr, Window window);
void wKWMSendWindowCreateMessage(WWindow *wwin, Bool create);
void wKWMSendEventMessage(WWindow *wwin, WKWMEventMessage message);
void wKWMCheckDestroy(XDestroyWindowEvent *event);
void wKWMUpdateActiveWindowHint(WScreen *scr);
void wKWMSendStacking(WScreen *scr, Window module);
void wKWMBroadcastStacking(WScreen *scr);
char *wKWMGetWorkspaceName(WScreen *scr, int workspace);
Bool wKWMGetIconGeometry(WWindow *wwin, WArea *area);
void wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h,
Bool control);
#endif

View File

@@ -47,10 +47,6 @@
#include <WINGs/WINGsP.h>
#ifdef KWM_HINTS
#include "kwm.h"
#endif
/* How many different types of geometry/position
display thingies are there? */
#define NUM_DISPLAYS 5
@@ -2327,11 +2323,6 @@ wSelectWindows(WScreen *scr, XEvent *ev)
XUngrabPointer(dpy, CurrentTime);
selectWindowsInside(scr, x, y, x + w, y + h);
#ifdef KWM_HINTS
wKWMSelectRootRegion(scr, xp, yp, w, h,
event.xbutton.state & ControlMask);
#endif /* KWM_HINTS */
#ifdef DEBUG
puts("End window selection");
#endif

View File

@@ -1,429 +0,0 @@
/*
* openlook.c - OPEN LOOK (tm) compatibility stuff
*
* Window Maker window manager
*
* Copyright (c) 1998-2003 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
/*
* Semantics and hint information taken from olwm code
*/
#include "wconfig.h"
#ifdef OLWM_HINTS
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "WindowMaker.h"
#include "wcore.h"
#include "framewin.h"
#include "window.h"
#include "properties.h"
#include "icon.h"
#include "client.h"
#include "funcs.h"
#include "openlook.h"
/* pin states */
#define OL_PIN_OUT 0
#define OL_PIN_IN 1
/* flags */
#define OL_DECORATION_HEADER (1<<0)
#define OL_DECORATION_FOOTER (1<<1)
#define OL_DECORATION_PUSHPIN (1<<2)
#define OL_DECORATION_CLOSEBUTTON (1<<3)
#define OL_DECORATION_RESIZEABLE (1<<4)
#define OL_DECORATION_ICONNAME (1<<5)
#define OL_DECORATION_WARPTOPIN (1<<6)
#define OL_DECORATION_NONE (1<<7)
typedef struct {
long flags;
Atom winType;
Atom menuType;
long pinInitState;
long cancel;
} OLHints;
#define OL_WINTYPE (1<<0)
#define OL_MENUTYPE (1<<1)
#define OL_PINSTATE (1<<2)
#define OL_CANCEL (1<<3)
typedef struct {
unsigned used:1;
unsigned semantic:1;
unsigned semantic_compose:1;
unsigned semantic_capslock:1;
unsigned semantic_numlock:1;
unsigned semantic_scrolllock:1;
} WOLWindowState;
static Atom _XA_SUN_WM_PROTOCOLS = 0;
#ifdef unused
static Bool
getWindowState(Window win, OLWindowState *state)
{
static Atom _XA_SUN_WINDOW_STATE = 0;
unsigned long *data;
if (!_XA_SUN_WINDOW_STATE) {
_XA_SUN_WINDOW_STATE = XInternAtom(dpy, "_SUN_WINDOW_STATE", False);
}
data = (unsigned long*)PropGetCheckProperty(win, _XA_SUN_WINDOW_STATE,
XA_INTEGER, 32, 2, NULL);
if (!data) {
return False;
}
state->flags = data[0];
state->state = data[1];
XFree(data);
return True;
}
#endif
static Bool
getWindowHints(Window window, OLHints *hints)
{
long *data;
int count;
static Atom _XA_OL_WIN_ATTR = 0;
if (!_XA_OL_WIN_ATTR) {
_XA_OL_WIN_ATTR = XInternAtom(dpy, "_OL_WIN_ATTR", False);
}
data = (long*)PropGetCheckProperty(window, _XA_OL_WIN_ATTR,
_XA_OL_WIN_ATTR, 32, 0, &count);
if (!data)
return False;
if (count == 3) {
/* old format */
hints->flags = OL_WINTYPE|OL_MENUTYPE|OL_PINSTATE;
hints->winType = data[0];
hints->menuType = data[1];
hints->pinInitState = data[2];
hints->cancel = 0;
} else if (count == 5) {
/* new format */
hints->flags = data[0];
hints->winType = data[1];
hints->menuType = data[2];
hints->pinInitState = data[3];
hints->cancel = data[4];
} else {
XFree(data);
return False;
}
XFree(data);
/* do backward compatibility stuff */
if (hints->flags & OL_PINSTATE) {
static Atom pinIn = 0, pinOut;
if (!pinIn) {
pinIn = XInternAtom(dpy, "_OL_PIN_IN", False);
pinOut = XInternAtom(dpy, "_OL_PIN_OUT", False);
}
if (hints->pinInitState == pinIn)
hints->pinInitState = OL_PIN_IN;
else if (hints->pinInitState == pinOut)
hints->pinInitState = OL_PIN_OUT;
}
return True;
}
static void
applyDecorationHints(Window win, int *flags)
{
Atom *atoms;
static Atom _XA_OL_DECOR_ADD = 0;
static Atom _XA_OL_DECOR_DEL = 0;
static Atom _XA_CLOSE, _XA_FOOTER, _XA_RESIZE, _XA_HEADER, _XA_PIN,
_XA_ICONNAME;
int count;
int i;
if (!_XA_OL_DECOR_DEL) {
_XA_OL_DECOR_ADD = XInternAtom(dpy, "_OL_DECOR_ADD", False);
_XA_OL_DECOR_DEL = XInternAtom(dpy, "_OL_DECOR_DEL", False);
_XA_CLOSE = XInternAtom(dpy, "_OL_DECOR_CLOSE", False);
_XA_FOOTER = XInternAtom(dpy, "_OL_DECOR_FOOTER", False);
_XA_RESIZE = XInternAtom(dpy, "_OL_DECOR_RESIZE", False);
_XA_HEADER = XInternAtom(dpy, "_OL_DECOR_HEADER", False);
_XA_PIN = XInternAtom(dpy, "_OL_DECOR_PIN", False);
_XA_ICONNAME = XInternAtom(dpy, "_OL_DECOR_ICON_NAME", False);
}
atoms = (Atom*)PropGetCheckProperty(win, _XA_OL_DECOR_ADD, XA_ATOM, 32, 0,
&count);
if (atoms) {
for (i=0; i < count; i++) {
if (atoms[i] == _XA_CLOSE)
*flags |= OL_DECORATION_CLOSEBUTTON;
else if (atoms[i] == _XA_FOOTER)
*flags |= OL_DECORATION_FOOTER;
else if (atoms[i] == _XA_RESIZE)
*flags |= OL_DECORATION_RESIZEABLE;
else if (atoms[i] == _XA_HEADER)
*flags |= OL_DECORATION_HEADER;
else if (atoms[i] == _XA_PIN)
*flags |= OL_DECORATION_PUSHPIN;
else if (atoms[i] == _XA_ICONNAME)
*flags |= OL_DECORATION_ICONNAME;
}
XFree(atoms);
}
atoms = (Atom*)PropGetCheckProperty(win, _XA_OL_DECOR_DEL, XA_ATOM, 32, 0,
&count);
if (atoms) {
for (i=0; i < count; i++) {
if (atoms[i] == _XA_CLOSE)
*flags &= ~OL_DECORATION_CLOSEBUTTON;
else if (atoms[i] == _XA_FOOTER)
*flags &= ~OL_DECORATION_FOOTER;
else if (atoms[i] == _XA_RESIZE)
*flags &= ~OL_DECORATION_RESIZEABLE;
else if (atoms[i] == _XA_HEADER)
*flags &= ~OL_DECORATION_HEADER;
else if (atoms[i] == _XA_PIN)
*flags &= ~OL_DECORATION_PUSHPIN;
else if (atoms[i] == _XA_ICONNAME)
*flags &= ~OL_DECORATION_ICONNAME;
}
XFree(atoms);
}
}
void
wOLWMInitStuff(WScreen *scr)
{
static Atom _SUN_OL_WIN_ATTR_5;
if (!_XA_SUN_WM_PROTOCOLS) {
_XA_SUN_WM_PROTOCOLS = XInternAtom(dpy, "_SUN_WM_PROTOCOLS", False);
_SUN_OL_WIN_ATTR_5 = XInternAtom(dpy, "_SUN_OL_WIN_ATTR_5", False);
}
XChangeProperty(dpy, scr->root_win, _XA_SUN_WM_PROTOCOLS, XA_ATOM, 32,
PropModeReplace, (unsigned char*)&_SUN_OL_WIN_ATTR_5, 1);
}
void
wOLWMChangePushpinState(WWindow *wwin, Bool state)
{
static Atom pinState = 0;
if (!pinState) {
pinState = XInternAtom(dpy, "_OL_PIN_STATE", False);
}
XChangeProperty(dpy, wwin->client_win, pinState, XA_INTEGER, 32,
PropModeReplace, (unsigned char *)&state, 1);
}
void
wOLWMShutdown(WScreen *scr)
{
XDeleteProperty(dpy, scr->root_win, _XA_SUN_WM_PROTOCOLS);
}
#ifdef unfinished
void
wOLWMUpdateWindowState(WWindow *wwin)
{
if (wwin->ol_window_state.used) {
if (wwin->ol_window_state.semantic) {
if (wwin->ol_window_state.semantic_compose)
setComposeLed(True);
else
setComposeLed(False);
}
} else {
setComposeLed(False);
}
}
#endif /* unfinished */
void
wOLWMCheckClientHints(WWindow *wwin)
{
OLHints hints;
static Atom WT_BASE = 0, WT_CMD, WT_NOTICE, WT_HELP, WT_OTHER;
static Atom MT_FULL, MT_LIMITED, MT_NONE;
int decoration;
int pinInitState = OL_PIN_IN;
Atom menuType;
if (!WT_BASE) {
WT_BASE = XInternAtom(dpy, "_OL_WT_BASE", False);
WT_CMD = XInternAtom(dpy, "_OL_WT_CMD", False);
WT_NOTICE = XInternAtom(dpy, "_OL_WT_NOTICE", False);
WT_HELP = XInternAtom(dpy, "_OL_WT_HELP", False);
WT_OTHER = XInternAtom(dpy, "_OL_WT_OTHER", False);
MT_FULL = XInternAtom(dpy, "_OL_MENU_FULL", False);
MT_LIMITED = XInternAtom(dpy, "_OL_MENU_LIMITED", False);
MT_NONE = XInternAtom(dpy, "_OL_NONE", False);
}
/* get attributes */
if (!getWindowHints(wwin->client_win, &hints) ||
!(hints.flags & OL_WINTYPE)) {
decoration = OL_DECORATION_CLOSEBUTTON|OL_DECORATION_RESIZEABLE
|OL_DECORATION_HEADER|OL_DECORATION_ICONNAME;
menuType = MT_FULL;
} else {
if (hints.winType == WT_BASE) {
decoration = OL_DECORATION_CLOSEBUTTON|OL_DECORATION_RESIZEABLE
|OL_DECORATION_HEADER|OL_DECORATION_ICONNAME;
menuType = MT_FULL;
} else if (hints.winType == WT_CMD) {
decoration = OL_DECORATION_PUSHPIN|OL_DECORATION_RESIZEABLE
|OL_DECORATION_HEADER|OL_DECORATION_ICONNAME;
menuType = MT_LIMITED;
/* this is a transient-like window */
wwin->client_flags.olwm_transient = 1;
} else if (hints.winType == WT_NOTICE) {
decoration = OL_DECORATION_ICONNAME;
menuType = MT_NONE;
} else if (hints.winType == WT_HELP) {
decoration = OL_DECORATION_PUSHPIN|OL_DECORATION_HEADER
|OL_DECORATION_ICONNAME|OL_DECORATION_WARPTOPIN;
menuType = MT_LIMITED;
} else if (hints.winType == WT_OTHER) {
decoration = OL_DECORATION_ICONNAME;
menuType = MT_NONE;
if (hints.flags & OL_MENUTYPE) {
menuType = hints.menuType;
}
}
if (hints.flags & OL_PINSTATE) {
pinInitState = hints.pinInitState;
} else {
pinInitState = OL_PIN_OUT;
}
}
/* mask attributes with decoration hints */
applyDecorationHints(wwin->client_win, &decoration);
if ((decoration & OL_DECORATION_CLOSEBUTTON)
&& (decoration & OL_DECORATION_PUSHPIN))
decoration &= ~OL_DECORATION_CLOSEBUTTON;
if (!(decoration & OL_DECORATION_PUSHPIN))
decoration &= ~OL_DECORATION_WARPTOPIN;
/* map the hints to our attributes */
if (menuType == MT_FULL)
wwin->flags.olwm_limit_menu = 0;
else
wwin->flags.olwm_limit_menu = 1;
/*
* Emulate olwm pushpin.
* If the initial state of the pin is in, then put the normal close
* button. If not, make the close button different and when the
* user moves the window or clicks in the close button, turn it
* into a normal close button.
*/
if ((decoration & OL_DECORATION_PUSHPIN) && pinInitState==OL_PIN_OUT) {
wwin->flags.olwm_push_pin_out = 1;
wOLWMChangePushpinState(wwin, False);
} else {
wOLWMChangePushpinState(wwin, True);
}
if (!(decoration & OL_DECORATION_RESIZEABLE)) {
wwin->client_flags.no_resizable = 1;
wwin->client_flags.no_resizebar = 1;
}
if (decoration & OL_DECORATION_WARPTOPIN) {
wwin->client_flags.olwm_warp_to_pin = 1;
}
}
#endif

View File

@@ -1,37 +0,0 @@
/*
* openlook.h - OPEN LOOK (tm) compatibility stuff
*
* Window Maker window manager
*
* Copyright (c) 1998-2003 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#ifndef _OPENLOOK_H_
#define _OPENLOOK_H_
void wOLWMInitStuff(WScreen *scr);
void wOLWMShutdown(WScreen *scr);
void wOLWMCheckClientHints(WWindow *wwin);
void wOLWMChangePushpinState(WWindow *wwin, Bool state);
#endif

View File

@@ -373,10 +373,6 @@ PropCleanUp(Window root)
XDeleteProperty(dpy, root, _XA_WINDOWMAKER_NOTICEBOARD);
XDeleteProperty(dpy, root, XA_WM_ICON_SIZE);
#ifdef KWM_HINTS
XDeleteProperty(dpy, root, XInternAtom(dpy, "KWM_RUNNING", False));
#endif
}

View File

@@ -53,15 +53,6 @@
#include "session.h"
#include "balloon.h"
#include "geomview.h"
#ifdef KWM_HINTS
# include "kwm.h"
#endif
#ifdef GNOME_STUFF
# include "gnome.h"
#endif
#ifdef OLWM_HINTS
# include "openlook.h"
#endif
#ifdef NETWM_HINTS
# include "wmspec.h"
#endif
@@ -778,18 +769,6 @@ wScreenInit(int screen_number)
createInternalWindows(scr);
#ifdef KWM_HINTS
wKWMInitStuff(scr);
#endif
#ifdef GNOME_STUFF
wGNOMEInitStuff(scr);
#endif
#ifdef OLWM_HINTS
wOLWMInitStuff(scr);
#endif
#ifdef NETWM_HINTS
wNETWMInitStuff(scr);
#endif
@@ -892,30 +871,6 @@ wScreenUpdateUsableArea(WScreen *scr)
}
#endif
#ifdef GNOME_STUFF
{
WArea area;
if (wGNOMEGetUsableArea(scr, i, &area)) {
scr->totalUsableArea[i].x1 = WMAX(scr->totalUsableArea[i].x1, area.x1);
scr->totalUsableArea[i].y1 = WMAX(scr->totalUsableArea[i].y1, area.y1);
scr->totalUsableArea[i].x2 = WMIN(scr->totalUsableArea[i].x2, area.x2);
scr->totalUsableArea[i].y2 = WMIN(scr->totalUsableArea[i].y2, area.y2);
}
}
#endif
#ifdef KWM_HINTS
{
WArea area;
if (wKWMGetUsableArea(scr, i, &area)) {
scr->totalUsableArea[i].x1 = WMAX(scr->totalUsableArea[i].x1, area.x1);
scr->totalUsableArea[i].y1 = WMAX(scr->totalUsableArea[i].y1, area.y1);
scr->totalUsableArea[i].x2 = WMIN(scr->totalUsableArea[i].x2, area.x2);
scr->totalUsableArea[i].y2 = WMIN(scr->totalUsableArea[i].y2, area.y2);
}
}
#endif
scr->usableArea[i] = scr->totalUsableArea[i];
#if 0
@@ -1033,64 +988,6 @@ wScreenUpdateUsableArea(WScreen *scr)
}
#endif
#ifdef KWM_HINTS
{
WArea area;
if (wKWMGetUsableArea(scr, &area)) {
scr->totalUsableArea.x1 = WMAX(scr->totalUsableArea.x1, area.x1);
scr->totalUsableArea.y1 = WMAX(scr->totalUsableArea.y1, area.y1);
scr->totalUsableArea.x2 = WMIN(scr->totalUsableArea.x2, area.x2);
scr->totalUsableArea.y2 = WMIN(scr->totalUsableArea.y2, area.y2);
}
}
#endif
#ifdef GNOME_STUFF
{
WReservedArea *area = scr->reservedAreas;
while (area) {
int th, bh;
int lw, rw;
int w, h;
w = area->area.x2 - area->area.x1;
h = area->area.y2 - area->area.y1;
th = area->area.y1;
bh = scr->scr_height - area->area.y2;
lw = area->area.x1;
rw = scr->scr_width - area->area.x2;
if (WMIN(th, bh) <= WMIN(lw, rw)) {
/* horizontal */
if (th < bh) {
/* on top */
if (scr->totalUsableArea.y1 < area->area.y2)
scr->totalUsableArea.y1 = area->area.y2;
} else {
/* on bottom */
if (scr->totalUsableArea.y2 > area->area.y1)
scr->totalUsableArea.y2 = area->area.y1;
}
} else {
/* vertical */
if (lw < rw) {
/* on left */
if (scr->totalUsableArea.x1 < area->area.x2)
scr->totalUsableArea.x1 = area->area.x2;
} else {
/* on right */
if (scr->totalUsableArea.x2 > area->area.x1)
scr->totalUsableArea.x2 = area->area.x1;
}
}
area = area->next;
}
}
#endif /* GNOME_STUFF */
if (scr->totalUsableArea.x2 - scr->totalUsableArea.x1 < scr->scr_width/2) {
scr->totalUsableArea.x2 = scr->usableArea.x2;
scr->totalUsableArea.x1 = scr->usableArea.x1;
@@ -1100,18 +997,6 @@ wScreenUpdateUsableArea(WScreen *scr)
scr->totalUsableArea.y1 = scr->usableArea.y1;
}
#ifdef not_used
#ifdef KWM_HINTS
{
int i;
for (i = 0; i < scr->workspace_count; i++) {
wKWMSetUsableAreaHint(scr, i);
}
}
#endif
#endif
#ifdef NETWM_HINTS
wNETWMUpdateWorkarea(scr);
#endif

View File

@@ -299,10 +299,6 @@ typedef struct _WScreen {
char *xdestring;
#endif
#ifdef KWM_HINTS
Window kwm_dock;
#endif
#ifdef NETWM_HINTS
struct NetData *netdata;
#endif
@@ -327,10 +323,6 @@ typedef struct _WScreen {
unsigned int doing_alt_tab:1;
unsigned int jump_back_pending:1;
unsigned int ignore_focus_events:1;
#ifdef KWM_HINTS
unsigned int kwm_syncing_name:1;
unsigned int kwm_syncing_count:1;
#endif
} flags;
} WScreen;

View File

@@ -36,12 +36,6 @@
#include "properties.h"
#include "session.h"
#include "winspector.h"
#ifdef KWM_HINTS
# include "kwm.h"
#endif
#ifdef OLWM_HINTS
# include "openlook.h"
#endif
extern Atom _XA_WM_DELETE_WINDOW;
extern Time LastTimestamp;
@@ -105,9 +99,6 @@ Shutdown(WShutdownMode mode)
#endif
wSessionSaveClients(scr);
#ifdef KWM_HINTS
wKWMShutdown(scr, True);
#endif
wScreenSaveState(scr);
if (mode == WSKillMode)
@@ -128,14 +119,7 @@ Shutdown(WShutdownMode mode)
if (scr) {
if (scr->helper_pid)
kill(scr->helper_pid, SIGKILL);
#ifdef KWM_HINTS
wKWMShutdown(scr, False);
#endif
#ifdef OLWM_HINTS
wOLWMShutdown(scr);
#endif
wScreenSaveState(scr);
RestoreDesktop(scr);
}
}

View File

@@ -64,10 +64,6 @@
#include "xutil.h"
#ifdef KWM_HINTS
#include "kwm.h"
#endif
#if 0
#ifdef SYS_SIGLIST_DECLARED
extern const char * const sys_siglist[];
@@ -882,10 +878,6 @@ StartUp(Bool defaultScreenOnly)
} else {
wSessionRestoreLastWorkspace(wScreen[j]);
}
#ifdef KWM_HINTS
wKWMSetInitializedHint(wScreen[j]);
#endif
}
if (wScreenCount == 0) {
@@ -965,9 +957,6 @@ manageAllWindows(WScreen *scr, int crashRecovery)
if (children[i] == None)
continue;
#ifdef KWM_HINTS
wKWMCheckModule(scr, children[i]);
#endif
wwin = wManageWindow(scr, children[i]);
if (wwin) {
/* apply states got from WSavedState */

View File

@@ -68,9 +68,7 @@
/*
* support for XDND drop in the Dock. Experimental
*/
#ifdef GNOME_STUFF
#define XDND
#endif
/*#define XDND*/
/*
* support for Motif window manager (mwm) window hints
@@ -534,12 +532,7 @@
#define MAX_ICON_WIDTH 60 /* size of the icon pixmap */
#define MAX_ICON_HEIGHT 48
/* KDE may have problems with more than 32 workspaces */
#ifdef KWM_HINTS
# define MAX_WORKSPACES 32
#else
# define MAX_WORKSPACES 100
#endif
#define MAX_WORKSPACES 100
#define MAX_MENU_TEXT_LENGTH 512

View File

@@ -59,15 +59,6 @@
#ifdef MWM_HINTS
# include "motif.h"
#endif
#ifdef KWM_HINTS
# include "kwm.h"
#endif
#ifdef GNOME_STUFF
# include "gnome.h"
#endif
#ifdef OLWM_HINTS
# include "openlook.h"
#endif
#ifdef NETWM_HINTS
# include "wmspec.h"
#endif
@@ -443,20 +434,6 @@ wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace)
check = wNETWMCheckClientHints(wwin, &tmp_level, &tmp_workspace);
#endif
#ifdef GNOME_STUFF
if (!check)
check = wGNOMECheckClientHints(wwin, &tmp_level, &tmp_workspace);
#endif /* GNOME_STUFF */
#ifdef KWM_HINTS
if (!check)
check = wKWMCheckClientHints(wwin, &tmp_level, &tmp_workspace);
#endif /* KWM_HINTS */
#ifdef OLWM_HINTS
wOLWMCheckClientHints(wwin);
#endif /* OLWM_HINTS */
/* 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
*/
@@ -749,15 +726,6 @@ wManageWindow(WScreen *scr, Window window)
title = NULL;
}
#ifdef KWM_HINTS
if (title && !wKWMManageableClient(scr, window, title)) {
XFree(title);
XUngrabServer(dpy);
return NULL;
}
#endif /* KWM_HINTS */
wwin = wWindowCreate();
XSaveContext(dpy, window, wWinContext, (XPointer)&wwin->client_descriptor);
@@ -882,24 +850,6 @@ wManageWindow(WScreen *scr, Window window)
wWindowSetupInitialAttributes(wwin, &window_level, &workspace);
#ifdef OLWM_HINTS
if (wwin->client_flags.olwm_transient && wwin->transient_for==None
&& wwin->group_id != None && wwin->group_id != window) {
transientOwner = wWindowFor(wwin->group_id);
if (transientOwner) {
wwin->transient_for = wwin->group_id;
/* transients can't be iconified or maximized */
if (wwin->transient_for) {
WSETUFLAG(wwin, no_miniaturizable, 1);
WSETUFLAG(wwin, no_miniaturize_button, 1);
}
}
}
#endif /* OLWM_HINTS */
/* Make broken apps behave as a nice app. */
if (WFLAGP(wwin, emulate_appicon)) {
wwin->main_window = wwin->client_win;
@@ -1023,24 +973,9 @@ wManageWindow(WScreen *scr, Window window)
wwin->flags.maximized = MAX_VERTICAL|MAX_HORIZONTAL;
}
{
#if defined(NETWM_HINTS) || defined(GNOME_STUFF) || defined(KWM_HINTS)
Bool bla = False;
#endif
#ifdef NETWM_HINTS
if (!bla)
bla = wNETWMCheckInitialClientState(wwin);
wNETWMCheckInitialClientState(wwin);
#endif
#ifdef GNOME_STUFF
if (!bla)
bla = wGNOMECheckInitialClientState(wwin);
#endif
#ifdef KWM_HINTS
if (!bla)
bla = wKWMCheckClientInitialState(wwin);
#endif
}
/* apply previous state if it exists and we're in startup */
if (scr->flags.startup && wm_state >= 0) {
@@ -1371,16 +1306,6 @@ wManageWindow(WScreen *scr, Window window)
wwin->frame->child = wwin;
#ifdef OLWM_HINTS
/* emulate olwm push pin. Make the button look as pushed-in for
* the pinned-out state. When the button is clicked, it will
* revert to the normal position, which means the pin is pinned-in.
*/
if (wwin->flags.olwm_push_pin_out)
wFrameWindowUpdatePushButton(wwin->frame, True);
#endif /* OLWM_HINTS */
wwin->frame->workspace = workspace;
wwin->frame->on_click_left = windowIconifyClick;
@@ -1611,16 +1536,6 @@ wManageWindow(WScreen *scr, Window window)
wColormapInstallForWindow(scr, scr->cmap_window);
#ifdef OLWM_HINTS
if (wwin->client_flags.olwm_warp_to_pin && wwin->frame->titlebar != NULL
&& !WFLAGP(wwin, no_close_button) && !withdraw) {
XWarpPointer(dpy, None, None, 0, 0, 0, 0,
wwin->frame_x + width - wwin->frame->titlebar->height * 2,
wwin->frame_y);
}
#endif
/*
*------------------------------------------------------------
* Setup Notification Observers
@@ -2328,9 +2243,6 @@ wWindowSynthConfigureNotify(WWindow *wwin)
sevent.xconfigure.override_redirect = False;
XSendEvent(dpy, wwin->client_win, False, StructureNotifyMask, &sevent);
#ifdef KWM_HINTS
wKWMSendEventMessage(wwin, WKWMChangedClient);
#endif
XFlush(dpy);
}
@@ -3354,18 +3266,6 @@ windowCloseClick(WCoreWindow *sender, void *data, XEvent *event)
if (event->xbutton.state & ControlMask) {
wClientKill(wwin);
} else {
#ifdef OLWM_HINTS
if (wwin->flags.olwm_push_pin_out) {
wwin->flags.olwm_push_pin_out = 0;
wOLWMChangePushpinState(wwin, True);
wFrameWindowUpdatePushButton(wwin->frame, False);
return;
}
#endif
if (wwin->protocols.DELETE_WINDOW && event->xbutton.state==0) {
/* send delete message */
wClientSendProtocol(wwin, _XA_WM_DELETE_WINDOW, LastTimestamp);

View File

@@ -146,12 +146,6 @@ typedef struct {
*/
unsigned int emulate_appicon:1;
/* toolkit specific attribute flags. These are unchangeable and
* unconfigurable and must not be saved as state. */
#ifdef OLWM_HINTS
unsigned int olwm_transient:1;
unsigned int olwm_warp_to_pin:1;
#endif
} WWindowAttributes;
@@ -250,10 +244,6 @@ typedef struct WWindow {
FocusMode focus_mode; /* type of keyboard input focus */
#ifdef OLWM_HINTS_unfinished
struct WOLWindowState ol_window_state;
#endif
long event_mask; /* the event mask thats selected */
#ifdef MONITOR_HEARTBEAT
@@ -309,15 +299,6 @@ typedef struct WWindow {
unsigned int user_changed_height:1;
unsigned int wm_name_changed:1;
#ifdef KWM_HINTS
unsigned int kwm_hidden_for_modules:1;
unsigned int kwm_managed:1;
unsigned int kwm_menubar:1;
#endif
#ifdef OLWM_HINTS
unsigned int olwm_push_pin_out:1;/* emulate pushpin behaviour */
unsigned int olwm_limit_menu:1;
#endif
#ifdef NETWM_HINTS
unsigned int net_state_from_client:1; /* state hint was set by client */
unsigned int net_skip_pager:1;

View File

@@ -47,9 +47,6 @@
#include "actions.h"
#include "workspace.h"
#include "appicon.h"
#ifdef KWM_HINTS
#include "kwm.h"
#endif
#ifdef NETWM_HINTS
#include "wmspec.h"
#endif
@@ -105,11 +102,6 @@ wWorkspaceNew(WScreen *scr)
wspace = wmalloc(sizeof(WWorkspace));
wspace->name = NULL;
#ifdef KWM_HINTS
if (scr->flags.kwm_syncing_count) {
wspace->name = wKWMGetWorkspaceName(scr, scr->workspace_count-1);
}
#endif
if (!wspace->name) {
wspace->name = wmalloc(strlen(_("Workspace %i"))+8);
sprintf(wspace->name, _("Workspace %i"), scr->workspace_count);
@@ -635,10 +627,8 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
}
}
#if defined KWM_HINTS || defined NETWM_HINTS
wScreenUpdateUsableArea(scr);
#endif
#ifdef NETWM_HINTS
wScreenUpdateUsableArea(scr);
wNETWMUpdateDesktop(scr);
#endif