1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 15:12:32 +01:00

- Fixed a bug that crashed wmaker when closing a window if multiple screens

were managed by wmaker (Valery Kotchiev <aggregator@nospam.dk>)
- Fixed a problem that crashed wmaker when trying to read an unexisting
  WMState.<number> file on multihead system.
- Fixed problem with keyboard shortcuts executed an every screen for
  multihead systems.
This commit is contained in:
dan
2001-12-28 03:29:50 +00:00
parent 9031641ba6
commit 9e615bcff9
12 changed files with 173 additions and 140 deletions

View File

@@ -556,23 +556,24 @@ handleDestroyNotify(XEvent *event)
wUnmanageWindow(wwin, False, True);
}
while ((index = WMFindInArray(scr->fakeGroupLeaders, matchWindow,
(void*)window)) != WANotFound) {
WFakeGroupLeader *fPtr;
if (scr != NULL) {
while ((index = WMFindInArray(scr->fakeGroupLeaders, matchWindow,
(void*)window)) != WANotFound) {
WFakeGroupLeader *fPtr;
fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);
if (fPtr->retainCount > 0) {
fPtr->retainCount--;
if (fPtr->retainCount==0 && fPtr->leader!=None) {
XDestroyWindow(dpy, fPtr->leader);
fPtr->leader = None;
XFlush(dpy);
fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);
if (fPtr->retainCount > 0) {
fPtr->retainCount--;
if (fPtr->retainCount==0 && fPtr->leader!=None) {
XDestroyWindow(dpy, fPtr->leader);
fPtr->leader = None;
XFlush(dpy);
}
}
fPtr->origLeader = None;
}
fPtr->origLeader = None;
}
app = wApplicationOf(window);
if (app) {
if (window == app->main_window) {
@@ -1364,8 +1365,8 @@ handleKeyPress(XEvent *event)
break;
}
}
if (command < 0) {
#ifdef LITE
{

View File

@@ -419,10 +419,19 @@ wRootMenuPerformShortcut(XEvent *event)
Shortcut *ptr;
int modifiers;
int done = 0;
Window dummy;
int foo;
if (wScreenCount>1 &&
XQueryPointer(dpy, event->xkey.root, &dummy, &dummy, &foo, &foo, &foo,
&foo, &foo)==False) {
/* Pointer is not on this screen. */
return True;
}
/* ignore CapsLock */
modifiers = event->xkey.state & ValidModMask;
for (ptr = shortcutList; ptr!=NULL; ptr = ptr->next) {
if (ptr->keycode==0)
continue;

View File

@@ -1018,9 +1018,9 @@ wScreenRestoreState(WScreen *scr)
make_keys();
if (wScreenCount == 1)
if (wScreenCount == 1) {
path = wdefaultspathfordomain("WMState");
else {
} else {
char buf[16];
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
path = wdefaultspathfordomain(buf);
@@ -1028,14 +1028,14 @@ wScreenRestoreState(WScreen *scr)
scr->session_state = WMReadPropListFromFile(path);
wfree(path);
if (!scr->session_state && wScreenCount>1) {
char buf[16];
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
path = wdefaultspathfordomain(buf);
/*char buf[16];
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);*/
path = wdefaultspathfordomain("WMState");
scr->session_state = WMReadPropListFromFile(path);
wfree(path);
}
if (!wPreferences.flags.noclip) {
if (!wPreferences.flags.noclip && scr->session_state) {
state = WMGetFromPLDictionary(scr->session_state, dClip);
scr->clip_icon = wClipRestoreState(scr, state);
}