mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 23:22:30 +01:00
Update to Window Maker 0.50.2
This commit is contained in:
@@ -76,6 +76,7 @@ LN_S = @LN_S@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
REDUCE_APPICONS = @REDUCE_APPICONS@
|
||||
|
||||
@@ -286,6 +286,7 @@ typedef struct WPreferences {
|
||||
|
||||
char ws_cycle; /* Cycle existing workspaces */
|
||||
|
||||
|
||||
unsigned int modifier_mask; /* mask to use as kbd modifier */
|
||||
|
||||
char save_session_on_exit; /* automatically save session on exit */
|
||||
|
||||
@@ -415,7 +415,7 @@ wUnshadeWindow(WWindow *wwin)
|
||||
/* if the window is focused, set the focus again as it was disabled during
|
||||
* shading */
|
||||
if (wwin->flags.focused)
|
||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||
|
||||
#ifdef GNOME_STUFF
|
||||
wGNOMEUpdateClientStateHint(wwin, False);
|
||||
|
||||
@@ -563,7 +563,7 @@ openApplicationMenu(WApplication *wapp, int x, int y)
|
||||
|
||||
if (!scr->icon_menu) {
|
||||
scr->icon_menu = createApplicationMenu(scr);
|
||||
free(scr->window_menu->entries[1]->text);
|
||||
free(scr->icon_menu->entries[1]->text);
|
||||
}
|
||||
|
||||
menu = scr->icon_menu;
|
||||
@@ -678,6 +678,9 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
|
||||
WObjDescriptor *desc;
|
||||
WApplication *wapp = wApplicationOf(aicon->icon->owner->main_window);
|
||||
|
||||
if (!wapp)
|
||||
return;
|
||||
|
||||
openApplicationMenu(wapp, event->xbutton.x_root,
|
||||
event->xbutton.y_root);
|
||||
|
||||
|
||||
@@ -719,6 +719,9 @@ wClientGetNormalHints(WWindow *wwin, XWindowAttributes *wattribs, Bool geometry,
|
||||
#ifdef DEBUG
|
||||
printf("PRE ICCCM\n");
|
||||
#endif
|
||||
#ifdef IGNORE_PPOSITION
|
||||
wwin->normal_hints->flags &= ~PPosition;
|
||||
#endif
|
||||
if (wwin->normal_hints->flags & (USPosition|PPosition)) {
|
||||
*x = wwin->normal_hints->x;
|
||||
*y = wwin->normal_hints->y;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
|
||||
@@ -1926,33 +1927,23 @@ again:
|
||||
/* only do basic error checking and verify for None texture */
|
||||
|
||||
nelem = PLGetNumberOfElements(value);
|
||||
if (nelem < 1) {
|
||||
wwarning(_("Too few elements in array for key \"WorkspaceBack\"."));
|
||||
if (changed==0) {
|
||||
value = entry->plvalue;
|
||||
changed = 1;
|
||||
wwarning(_("using default \"%s\" instead"), entry->default_value);
|
||||
goto again;
|
||||
}
|
||||
return False;
|
||||
if (nelem > 0) {
|
||||
elem = PLGetArrayElement(value, 0);
|
||||
if (!elem || !PLIsString(elem)) {
|
||||
wwarning(_("Wrong type for workspace background. Should be a texture type."));
|
||||
if (changed==0) {
|
||||
value = entry->plvalue;
|
||||
changed = 1;
|
||||
wwarning(_("using default \"%s\" instead"), entry->default_value);
|
||||
goto again;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
val = PLGetString(elem);
|
||||
|
||||
if (strcasecmp(val, "None")==0)
|
||||
return True;
|
||||
}
|
||||
|
||||
elem = PLGetArrayElement(value, 0);
|
||||
if (!elem || !PLIsString(elem)) {
|
||||
wwarning(_("Wrong type for workspace background. Should be a texture type."));
|
||||
if (changed==0) {
|
||||
value = entry->plvalue;
|
||||
changed = 1;
|
||||
wwarning(_("using default \"%s\" instead"), entry->default_value);
|
||||
goto again;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
val = PLGetString(elem);
|
||||
|
||||
if (strcasecmp(val, "None")==0)
|
||||
return True;
|
||||
|
||||
*ret = PLRetain(value);
|
||||
|
||||
return True;
|
||||
@@ -1983,17 +1974,13 @@ again:
|
||||
/* only do basic error checking and verify for None texture */
|
||||
|
||||
nelem = PLGetNumberOfElements(value);
|
||||
if (nelem < 0) {
|
||||
*ret = PLRetain(value);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
while (nelem--) {
|
||||
elem = PLGetArrayElement(value, nelem);
|
||||
if (!elem || !PLIsArray(elem)) {
|
||||
wwarning(_("Wrong type for background of workspace %i. Should be a texture."),
|
||||
nelem);
|
||||
if (nelem > 0) {
|
||||
while (nelem--) {
|
||||
elem = PLGetArrayElement(value, nelem);
|
||||
if (!elem || !PLIsArray(elem)) {
|
||||
wwarning(_("Wrong type for background of workspace %i. Should be a texture."),
|
||||
nelem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2568,11 +2555,9 @@ setWorkspaceSpecificBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
|
||||
|
||||
if (scr->flags.backimage_helper_launched) {
|
||||
if (PLGetNumberOfElements(value)==0) {
|
||||
kill(scr->helper_pid, SIGTERM);
|
||||
close(scr->helper_fd);
|
||||
scr->helper_fd = 0;
|
||||
scr->flags.backimage_helper_launched = 0;
|
||||
|
||||
SendHelperMessage(scr, 'C', 0, NULL);
|
||||
SendHelperMessage(scr, 'K', 0, NULL);
|
||||
|
||||
PLRelease(value);
|
||||
return 0;
|
||||
}
|
||||
@@ -2593,10 +2578,16 @@ setWorkspaceSpecificBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
|
||||
pid = fork();
|
||||
if (pid < 0) {
|
||||
wsyserror("fork() failed:can't set workspace specific background image");
|
||||
if (close(filedes[0]) < 0)
|
||||
wsyserror("could not close pipe");
|
||||
if (close(filedes[1]) < 0)
|
||||
wsyserror("could not close pipe");
|
||||
|
||||
} else if (pid == 0) {
|
||||
SetupEnvironment(scr);
|
||||
|
||||
close(0);
|
||||
if (close(0) < 0)
|
||||
wsyserror("could not close pipe");
|
||||
if (dup(filedes[0]) < 0) {
|
||||
wsyserror("dup() failed:can't set workspace specific background image");
|
||||
}
|
||||
@@ -2604,6 +2595,14 @@ setWorkspaceSpecificBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
|
||||
wsyserror("could not execute wmsetbg");
|
||||
exit(1);
|
||||
} else {
|
||||
|
||||
if (fcntl(filedes[0], F_SETFD, FD_CLOEXEC) < 0) {
|
||||
wsyserror("error setting close-on-exec flag");
|
||||
}
|
||||
if (fcntl(filedes[1], F_SETFD, FD_CLOEXEC) < 0) {
|
||||
wsyserror("error setting close-on-exec flag");
|
||||
}
|
||||
|
||||
scr->helper_fd = filedes[1];
|
||||
scr->helper_pid = pid;
|
||||
scr->flags.backimage_helper_launched = 1;
|
||||
@@ -2645,7 +2644,10 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
|
||||
if (str) {
|
||||
SendHelperMessage(scr, 'S', 0, str);
|
||||
free(str);
|
||||
} else {
|
||||
SendHelperMessage(scr, 'U', 0, NULL);
|
||||
}
|
||||
SendHelperMessage(scr, 'C', scr->current_workspace+1, NULL);
|
||||
} else {
|
||||
char *command;
|
||||
char *text;
|
||||
|
||||
16
src/dock.c
16
src/dock.c
@@ -2271,7 +2271,10 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||
int i, offset = ICON_SIZE/2;
|
||||
WAppIcon *aicon = NULL;
|
||||
WAppIcon *nicon = NULL;
|
||||
int max_y_icons, max_x_icons;
|
||||
|
||||
max_x_icons = scr->scr_width/ICON_SIZE;
|
||||
max_y_icons = scr->scr_height/ICON_SIZE-1;
|
||||
|
||||
if (wPreferences.flags.noupdates)
|
||||
return False;
|
||||
@@ -2284,7 +2287,7 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||
(dock->icon_count >= dock->max_icons)) {
|
||||
return False;
|
||||
}
|
||||
|
||||
|
||||
/* exact position */
|
||||
if (req_y < dy)
|
||||
ex_y = (req_y - offset - dy)/ICON_SIZE;
|
||||
@@ -2298,9 +2301,9 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||
|
||||
/* check if the icon is outside the screen boundaries */
|
||||
if (dx + ex_x*ICON_SIZE < -ICON_SIZE+2 ||
|
||||
dx + ex_x*ICON_SIZE > scr->scr_width-1 ||
|
||||
dx + ex_x*ICON_SIZE >= scr->scr_width-1 ||
|
||||
dy + ex_y*ICON_SIZE < -ICON_SIZE+2 ||
|
||||
dy + ex_y*ICON_SIZE > scr->scr_height-1)
|
||||
dy + ex_y*ICON_SIZE >= scr->scr_height-1)
|
||||
return False;
|
||||
|
||||
if (dock->type == WM_DOCK) {
|
||||
@@ -2330,10 +2333,11 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||
if (abs(ex_x) > DOCK_DETTACH_THRESHOLD)
|
||||
return False;
|
||||
|
||||
if (ex_y >=0 && (aicon == icon || !aicon)) {
|
||||
if (ex_y >= 0 && ex_y < max_y_icons && (aicon == icon || !aicon)) {
|
||||
|
||||
*ret_y = ex_y;
|
||||
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
@@ -2365,7 +2369,7 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||
}
|
||||
sig = -sig;
|
||||
}
|
||||
if (done && closest >= 0 &&
|
||||
if (done && closest >= 0 && closest < max_y_icons &&
|
||||
((ex_y >= closest && ex_y - closest < DOCK_DETTACH_THRESHOLD+1)
|
||||
||
|
||||
(ex_y < closest && closest - ex_y <= DOCK_DETTACH_THRESHOLD+1))) {
|
||||
@@ -2377,7 +2381,7 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||
} else { /* !redocking */
|
||||
|
||||
/* if slot is free and the icon is close enough, return it */
|
||||
if (!aicon && ex_x==0 && ex_y>=0) {
|
||||
if (!aicon && ex_x == 0 && ex_y >= 0 && ex_y < max_y_icons) {
|
||||
*ret_y = ex_y;
|
||||
return True;
|
||||
}
|
||||
|
||||
@@ -618,8 +618,15 @@ handleButtonPress(XEvent *event)
|
||||
wBalloonHide(scr);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef LITE
|
||||
if (event->xbutton.window==scr->root_win) {
|
||||
|
||||
#ifdef GNOME_STUFF
|
||||
if (wGNOMEProxyizeButtonEvent(scr, event))
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (event->xbutton.button==wPreferences.menu_button) {
|
||||
OpenRootMenu(scr, event->xbutton.x_root,
|
||||
event->xbutton.y_root, False);
|
||||
|
||||
56
src/gnome.c
56
src/gnome.c
@@ -52,6 +52,10 @@
|
||||
#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*/
|
||||
@@ -94,6 +98,7 @@ 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;
|
||||
|
||||
|
||||
void
|
||||
@@ -130,6 +135,9 @@ wGNOMEInitStuff(WScreen *scr)
|
||||
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
|
||||
@@ -138,7 +146,7 @@ wGNOMEInitStuff(WScreen *scr)
|
||||
|
||||
/* setup the "We're compliant, you idiot!" hint */
|
||||
|
||||
/* why XA_CARDINAL instead of XA_WINDOW? Only God knows.... */
|
||||
/* 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);
|
||||
@@ -147,6 +155,15 @@ wGNOMEInitStuff(WScreen *scr)
|
||||
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;
|
||||
@@ -317,7 +334,8 @@ wGNOMECheckClientHints(WWindow *wwin, int *layer, int *workspace)
|
||||
|
||||
XFree(data);
|
||||
|
||||
*workspace = val;
|
||||
if (val > 0)
|
||||
*workspace = val;
|
||||
}
|
||||
|
||||
/* reserved area */
|
||||
@@ -434,9 +452,23 @@ wGNOMEUpdateClientStateHint(WWindow *wwin, Bool changedWorkspace)
|
||||
Bool
|
||||
wGNOMEProcessClientMessage(XClientMessageEvent *event)
|
||||
{
|
||||
WScreen *scr;
|
||||
WWindow *wwin;
|
||||
Bool done = True;
|
||||
|
||||
scr = wScreenForRootWindow(event->window);
|
||||
if (scr) {
|
||||
/* generic client messages */
|
||||
if (event->message_type == _XA_WIN_WORKSPACE) {
|
||||
wWorkspaceChange(scr, event->data.l[0]);
|
||||
} else {
|
||||
done = False;
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
/* window specific client messages */
|
||||
|
||||
wwin = wWindowFor(event->window);
|
||||
if (!wwin)
|
||||
return False;
|
||||
@@ -518,6 +550,26 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
|
||||
}
|
||||
|
||||
|
||||
Bool
|
||||
wGNOMEProxyizeButtonEvent(WScreen *scr, XEvent *event)
|
||||
{
|
||||
#ifndef MOUSE_WS_SWITCH
|
||||
if (event->xbutton.button <= Button3
|
||||
&& (event->xbutton.state & ValidModMask) == 0)
|
||||
return False;
|
||||
#else
|
||||
if ((event->xbutton.state & ValidModMask) == 0)
|
||||
return False;
|
||||
#endif
|
||||
|
||||
if (event->type == ButtonPress)
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
XSendEvent(dpy, scr->no_focus_win, False, SubstructureNotifyMask, event);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wGNOMERemoveClient(WWindow *wwin)
|
||||
{
|
||||
|
||||
@@ -45,5 +45,7 @@ void wGNOMERemoveClient(WWindow *wwin);
|
||||
|
||||
void wGNOMECheckInitialClientState(WWindow *wwin);
|
||||
|
||||
Bool wGNOMEProxyizeButtonEvent(WScreen *scr, XEvent *event);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -406,9 +406,11 @@ getnameforicon(WWindow *wwin)
|
||||
} else if (wwin->wm_class) {
|
||||
suffix = wmalloc(strlen(wwin->wm_class)+1);
|
||||
strcpy(suffix, wwin->wm_class);
|
||||
} else {
|
||||
} else if (wwin->wm_instance) {
|
||||
suffix = wmalloc(strlen(wwin->wm_instance)+1);
|
||||
strcpy(suffix, wwin->wm_instance);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
prefix = getenv("GNUSTEP_USER_PATH");
|
||||
@@ -471,6 +473,8 @@ wIconStore(WIcon *icon)
|
||||
return NULL;
|
||||
|
||||
path = getnameforicon(wwin);
|
||||
if (!path)
|
||||
return NULL;
|
||||
|
||||
image = RCreateImageFromDrawable(icon->core->screen_ptr->rcontext,
|
||||
wwin->wm_hints->icon_pixmap,
|
||||
|
||||
20
src/kwm.c
20
src/kwm.c
@@ -27,7 +27,7 @@
|
||||
* kwm.h function/method Notes
|
||||
*----------------------------------------------------------------------------
|
||||
* setUnsavedDataHint() currently, only gives visual clue that
|
||||
* there is saved data (broken X close button)
|
||||
* there is unsaved data (broken X close button)
|
||||
* setSticky()
|
||||
* setIcon() std X thing...
|
||||
* setDecoration()
|
||||
@@ -638,14 +638,16 @@ wKWMSetInitializedHint(WScreen *scr)
|
||||
|
||||
|
||||
void
|
||||
wKWMShutdown(WScreen *scr)
|
||||
wKWMShutdown(WScreen *scr, Bool closeModules)
|
||||
{
|
||||
KWMModuleList *ptr;
|
||||
|
||||
XDeleteProperty(dpy, scr->root_win, _XA_KWM_RUNNING);
|
||||
|
||||
for (ptr = KWMModules; ptr != NULL; ptr = ptr->next) {
|
||||
XKillClient(dpy, ptr->window);
|
||||
if (closeModules) {
|
||||
for (ptr = KWMModules; ptr != NULL; ptr = ptr->next) {
|
||||
XKillClient(dpy, ptr->window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,7 +680,7 @@ wKWMCheckClientHints(WWindow *wwin, int *workspace)
|
||||
}
|
||||
}
|
||||
if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_DESKTOP, &val)) {
|
||||
*workspace = val;
|
||||
*workspace = val - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1376,9 +1378,6 @@ wKWMUpdateWorkspaceNameHint(WScreen *scr, int workspace)
|
||||
{
|
||||
char buffer[64];
|
||||
|
||||
if (scr->flags.kwm_syncing_name)
|
||||
return;
|
||||
|
||||
assert(workspace >= 0 && workspace < MAX_WORKSPACES);
|
||||
|
||||
if (_XA_KWM_DESKTOP_NAME_[workspace]==0) {
|
||||
@@ -1486,6 +1485,11 @@ wKWMSendEventMessage(WWindow *wwin, WKWMEventMessage message)
|
||||
{
|
||||
Atom msg;
|
||||
|
||||
if (wwin && (wwin->flags.internal_window
|
||||
|| wwin->flags.kwm_hidden_for_modules
|
||||
|| WFLAGP(wwin, skip_window_list)))
|
||||
return;
|
||||
|
||||
switch (message) {
|
||||
case WKWMAddWindow:
|
||||
msg = _XA_KWM_MODULE_WIN_ADD;
|
||||
|
||||
@@ -73,7 +73,7 @@ void wKWMSetUsableAreaHint(WScreen *scr, int workspace);
|
||||
|
||||
void wKWMSetInitializedHint(WScreen *scr);
|
||||
|
||||
void wKWMShutdown(WScreen *scr);
|
||||
void wKWMShutdown(WScreen *scr, Bool closeModules);
|
||||
|
||||
void wKWMCheckModule(WScreen *scr, Window window);
|
||||
|
||||
|
||||
@@ -1164,6 +1164,7 @@ editEntry(WMenu *menu, WMenuEntry *entry)
|
||||
|
||||
default:
|
||||
WMHandleEvent(&event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
40
src/misc.c
40
src/misc.c
@@ -782,7 +782,7 @@ getuserinput(WScreen *scr, char *line, int *ptr)
|
||||
char *ret;
|
||||
char *title;
|
||||
char *prompt;
|
||||
int i, j, k, state;
|
||||
int j, k, state;
|
||||
char tbuffer[256], pbuffer[256];
|
||||
|
||||
title = _("Program Arguments");
|
||||
@@ -796,10 +796,10 @@ getuserinput(WScreen *scr, char *line, int *ptr)
|
||||
|
||||
state = _STARTING;
|
||||
j = 0;
|
||||
for (i = 0; line[i]==0 && state!=_DONE; i++) {
|
||||
for (; line[*ptr]==0 && state!=_DONE; *ptr++) {
|
||||
switch (state) {
|
||||
case _STARTING:
|
||||
if (line[i]=='(') {
|
||||
if (line[*ptr]=='(') {
|
||||
state = _TITLE;
|
||||
} else {
|
||||
state = _DONE;
|
||||
@@ -807,45 +807,45 @@ getuserinput(WScreen *scr, char *line, int *ptr)
|
||||
break;
|
||||
|
||||
case _TITLE:
|
||||
if (j <= 0 && line[i]==',') {
|
||||
if (j <= 0 && line[*ptr]==',') {
|
||||
|
||||
j = 0;
|
||||
if (i > 1) {
|
||||
strncpy(tbuffer, &line[1], WMIN(i, 255));
|
||||
tbuffer[WMIN(i, 255)] = 0;
|
||||
if (*ptr > 1) {
|
||||
strncpy(tbuffer, &line[1], WMIN(*ptr, 255));
|
||||
tbuffer[WMIN(*ptr, 255)] = 0;
|
||||
title = (char*)tbuffer;
|
||||
}
|
||||
k = i+1;
|
||||
k = *ptr+1;
|
||||
state = _PROMPT;
|
||||
|
||||
} else if (j <= 0 && line[i]==')') {
|
||||
} else if (j <= 0 && line[*ptr]==')') {
|
||||
|
||||
if (i > 1) {
|
||||
strncpy(tbuffer, &line[1], WMIN(i, 255));
|
||||
tbuffer[WMIN(i, 255)] = 0;
|
||||
if (*ptr > 1) {
|
||||
strncpy(tbuffer, &line[1], WMIN(*ptr, 255));
|
||||
tbuffer[WMIN(*ptr, 255)] = 0;
|
||||
title = (char*)tbuffer;
|
||||
}
|
||||
state = _DONE;
|
||||
|
||||
} else if (line[i]=='(')
|
||||
} else if (line[*ptr]=='(')
|
||||
j++;
|
||||
else if (line[i]==')')
|
||||
else if (line[*ptr]==')')
|
||||
j--;
|
||||
|
||||
break;
|
||||
|
||||
case _PROMPT:
|
||||
if (line[i]==')' && j==0) {
|
||||
if (line[*ptr]==')' && j==0) {
|
||||
|
||||
if (i-k > 1) {
|
||||
strncpy(pbuffer, &line[k], WMIN(i-k, 255));
|
||||
pbuffer[WMIN(i-k, 255)] = 0;
|
||||
if (*ptr-k > 1) {
|
||||
strncpy(pbuffer, &line[k], WMIN(*ptr-k, 255));
|
||||
pbuffer[WMIN(*ptr-k, 255)] = 0;
|
||||
title = (char*)pbuffer;
|
||||
}
|
||||
state = _DONE;
|
||||
} else if (line[i]=='(')
|
||||
} else if (line[*ptr]=='(')
|
||||
j++;
|
||||
else if (line[i]==')')
|
||||
else if (line[*ptr]==')')
|
||||
j--;
|
||||
break;
|
||||
}
|
||||
|
||||
19
src/motif.c
19
src/motif.c
@@ -67,7 +67,7 @@
|
||||
#define MWM_DECOR_MINIMIZE (1L << 5)
|
||||
#define MWM_DECOR_MAXIMIZE (1L << 6)
|
||||
|
||||
#define PROP_MWM_HINTS_ELEMENTS 4
|
||||
#define PROP_MWM_HINTS_ELEMENTS 5
|
||||
|
||||
/* Motif window hints */
|
||||
typedef struct {
|
||||
@@ -75,6 +75,7 @@ typedef struct {
|
||||
long functions;
|
||||
long decorations;
|
||||
long inputMode;
|
||||
long unknown;
|
||||
} MWMHints;
|
||||
|
||||
static Atom _XA_MOTIF_WM_HINTS;
|
||||
@@ -220,6 +221,7 @@ static int
|
||||
getMWMHints(Window window, MWMHints *mwmhints)
|
||||
{
|
||||
unsigned long *data;
|
||||
int count;
|
||||
|
||||
if (!_XA_MOTIF_WM_HINTS) {
|
||||
_XA_MOTIF_WM_HINTS = XInternAtom(dpy, "_MOTIF_WM_HINTS", False);
|
||||
@@ -227,16 +229,19 @@ getMWMHints(Window window, MWMHints *mwmhints)
|
||||
|
||||
data = (unsigned long*)PropGetCheckProperty(window, _XA_MOTIF_WM_HINTS,
|
||||
_XA_MOTIF_WM_HINTS, 32,
|
||||
PROP_MWM_HINTS_ELEMENTS, NULL);
|
||||
0, &count);
|
||||
|
||||
if (!data)
|
||||
return 0;
|
||||
|
||||
mwmhints->flags = data[0];
|
||||
mwmhints->functions = data[1];
|
||||
mwmhints->decorations = data[2];
|
||||
mwmhints->inputMode = data[3];
|
||||
|
||||
if (count >= 4) {
|
||||
mwmhints->flags = data[0];
|
||||
mwmhints->functions = data[1];
|
||||
mwmhints->decorations = data[2];
|
||||
mwmhints->inputMode = data[3];
|
||||
if (count > 5)
|
||||
mwmhints->unknown = data[4];
|
||||
}
|
||||
XFree(data);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -583,6 +583,7 @@ flushMotion()
|
||||
{
|
||||
XEvent ev;
|
||||
|
||||
XSync(dpy, False);
|
||||
while (XCheckMaskEvent(dpy, ButtonMotionMask, &ev)) ;
|
||||
}
|
||||
|
||||
@@ -657,7 +658,7 @@ _keyloop(_looper *lpr){
|
||||
}
|
||||
XUngrabServer(dpy);
|
||||
XSync(dpy, False);
|
||||
usleep(10000);
|
||||
wusleep(10000);
|
||||
XGrabServer(dpy);
|
||||
printf("called\n");
|
||||
if (!scr->selected_windows){
|
||||
@@ -702,7 +703,7 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
ctrlmode=done=off_x=off_y=0;
|
||||
|
||||
XSync(dpy, False);
|
||||
usleep(10000);
|
||||
wusleep(10000);
|
||||
XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
|
||||
if (!wwin->flags.selected) {
|
||||
@@ -829,6 +830,8 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
||||
done=1;
|
||||
break;
|
||||
default:
|
||||
WMHandleEvent(&event);
|
||||
break;
|
||||
}
|
||||
/*
|
||||
XUngrabServer(dpy);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Window Maker window manager
|
||||
*
|
||||
* Copyright (c) 1998 Alfredo K. Kojima
|
||||
* Copyright (c) 1998, 1999 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
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "appicon.h"
|
||||
#include "dock.h"
|
||||
|
||||
#include "list.h"
|
||||
|
||||
extern WPreferences wPreferences;
|
||||
|
||||
|
||||
@@ -238,8 +240,6 @@ PlaceIcon(WScreen *scr, int *x_ret, int *y_ret)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static Bool
|
||||
smartPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
||||
unsigned int width, unsigned int height, int tryCount)
|
||||
@@ -251,7 +251,7 @@ smartPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
||||
WWindow *test_window;
|
||||
int extra_height;
|
||||
WArea usableArea = scr->totalUsableArea;
|
||||
|
||||
|
||||
if (wwin->frame)
|
||||
extra_height = wwin->frame->top_width + wwin->frame->bottom_width + 2;
|
||||
else
|
||||
@@ -337,6 +337,7 @@ smartPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
||||
}
|
||||
test_y += PLACETEST_VSTEP;
|
||||
}
|
||||
|
||||
return loc_ok;
|
||||
}
|
||||
|
||||
|
||||
@@ -930,7 +930,7 @@ smDieProc(SmcConn smc_conn, SmPointer client_data)
|
||||
|
||||
wSessionDisconnectManager();
|
||||
|
||||
Shutdown(WSExitMode);
|
||||
Shutdown(WSExitMode, True);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ Shutdown(WShutdownMode mode)
|
||||
kill(scr->helper_pid, SIGKILL);
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
wKWMShutdown(scr);
|
||||
wKWMShutdown(scr, True);
|
||||
#endif
|
||||
wScreenSaveState(scr);
|
||||
|
||||
@@ -101,7 +101,7 @@ Shutdown(WShutdownMode mode)
|
||||
if (scr->helper_pid)
|
||||
kill(scr->helper_pid, SIGKILL);
|
||||
#ifdef KWM_HINTS
|
||||
wKWMShutdown(scr);
|
||||
wKWMShutdown(scr, True);
|
||||
#endif
|
||||
wScreenSaveState(scr);
|
||||
|
||||
@@ -121,7 +121,7 @@ Shutdown(WShutdownMode mode)
|
||||
if (scr->helper_pid)
|
||||
kill(scr->helper_pid, SIGKILL);
|
||||
#ifdef KWM_HINTS
|
||||
wKWMShutdown(scr);
|
||||
wKWMShutdown(scr, False);
|
||||
#endif
|
||||
wScreenSaveState(scr);
|
||||
|
||||
|
||||
@@ -375,6 +375,8 @@ wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace)
|
||||
*level = WMSunkenLevel;
|
||||
else
|
||||
*level = WMNormalLevel;
|
||||
} else {
|
||||
*level = tmp_level;
|
||||
}
|
||||
|
||||
if (tmp_workspace >= 0) {
|
||||
@@ -1188,6 +1190,13 @@ wUnmanageWindow(WWindow *wwin, int restore)
|
||||
int wasNotFocused;
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
wwin->frame->workspace = -1;
|
||||
|
||||
wKWMUpdateClientWorkspace(wwin);
|
||||
#endif
|
||||
|
||||
/* First close attribute editor window if open */
|
||||
if (wwin->flags.inspector_open) {
|
||||
WWindow *pwin = wwin->inspector->frame; /* the inspector window */
|
||||
|
||||
@@ -528,11 +528,13 @@ updateMenuForWindow(WMenu *menu, WWindow *wwin)
|
||||
&& !WFLAGP(wwin, no_closable)));
|
||||
|
||||
if (wwin->flags.miniaturized) {
|
||||
static char *text = _("Deminiaturize");
|
||||
static char *text = NULL;
|
||||
if (!text) text = _("Deminiaturize");
|
||||
|
||||
menu->entries[MC_MINIATURIZE]->text = text;
|
||||
} else {
|
||||
static char *text = _("Miniaturize");
|
||||
static char *text = NULL;
|
||||
if (!text) text = _("Miniaturize");
|
||||
|
||||
menu->entries[MC_MINIATURIZE]->text = text;
|
||||
}
|
||||
@@ -540,11 +542,13 @@ updateMenuForWindow(WMenu *menu, WWindow *wwin)
|
||||
wMenuSetEnabled(menu, MC_MINIATURIZE, !WFLAGP(wwin, no_miniaturizable));
|
||||
|
||||
if (wwin->flags.maximized) {
|
||||
static char *text = _("Unmaximize");
|
||||
static char *text = NULL;
|
||||
if (!text) text = _("Unmaximize");
|
||||
|
||||
menu->entries[MC_MAXIMIZE]->text = text;
|
||||
} else {
|
||||
static char *text = _("Maximize");
|
||||
static char *text = NULL;
|
||||
if (!text) text = _("Maximize");
|
||||
|
||||
menu->entries[MC_MAXIMIZE]->text = text;
|
||||
}
|
||||
@@ -552,11 +556,13 @@ updateMenuForWindow(WMenu *menu, WWindow *wwin)
|
||||
wMenuSetEnabled(menu, MC_MOVERESIZE, !WFLAGP(wwin, no_resizable));
|
||||
|
||||
if (wwin->flags.shaded) {
|
||||
static char *text = _("Unshade");
|
||||
static char *text = NULL;
|
||||
if (!text) text = _("Unshade");
|
||||
|
||||
menu->entries[MC_SHADE]->text = text;
|
||||
} else {
|
||||
static char *text = _("Shade");
|
||||
static char *text = NULL;
|
||||
if (!text) text = _("Shade");
|
||||
|
||||
menu->entries[MC_SHADE]->text = text;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user