forked from e16/e16
1
0
Fork 0

Wed Sep 22 09:33:27 PDT 1999

(Raster)

fix the focus fixup - shoudl let focus change as per before AND fix up
transient focus errors too... i hope.. needs some testing.

added "set focus to logout are you ssure" dialog and make sure it accepts the
standard retrun/escape keybindings for "yes/no" like the settings dialogs do.


SVN revision: 365
This commit is contained in:
Carsten Haitzler 1999-09-22 16:27:50 +00:00
parent f93a5f8c22
commit 61c2190082
4 changed files with 47 additions and 16 deletions

View File

@ -2159,3 +2159,14 @@ Tue Sep 21 23:17:24 PDT 1999
(Raster) (Raster)
only allow one "default group settings" configuration dialog at a time only allow one "default group settings" configuration dialog at a time
-------------------------------------------------------------------------------
Wed Sep 22 09:33:27 PDT 1999
(Raster)
fix the focus fixup - shoudl let focus change as per before AND fix up
transient focus errors too... i hope.. needs some testing.
added "set focus to logout are you ssure" dialog and make sure it accepts the
standard retrun/escape keybindings for "yes/no" like the settings dialogs do.

View File

@ -1423,7 +1423,7 @@ CreateEwin()
XChangeWindowAttributes(disp, ewin->win_container, XChangeWindowAttributes(disp, ewin->win_container,
CWEventMask | CWDontPropagate, &att); CWEventMask | CWDontPropagate, &att);
EMapWindow(disp, ewin->win_container); EMapWindow(disp, ewin->win_container);
if (mode.focusmode == FOCUS_CLICK) if ((mode.clickalways) || (mode.focusmode == FOCUS_CLICK))
XGrabButton(disp, AnyButton, 0, ewin->win_container, False, XGrabButton(disp, AnyButton, 0, ewin->win_container, False,
ButtonPressMask, ButtonPressMask,
GrabModeSync, GrabModeAsync, None, None); GrabModeSync, GrabModeAsync, None, None);

View File

@ -14,26 +14,18 @@ FixUpBadFocus(int val, void *data)
if (mode.focusmode == FOCUS_CLICK) if (mode.focusmode == FOCUS_CLICK)
return; return;
XGetInputFocus(disp, &win, &revert); XGetInputFocus(disp, &win, &revert);
ewin = GetEwinPointerInClient(); ewin = FindItem("", win, LIST_FINDBY_ID, LIST_TYPE_EWIN);
if ((!ewin) && (mode.focusmode = FOCUS_POINTER))
{
ewin = FindItem("", win, LIST_FINDBY_ID, LIST_TYPE_EWIN);
if (ewin)
{
XSetInputFocus(disp, root.win, RevertToPointerRoot, CurrentTime);
mode.focuswin = NULL;
mode.realfocuswin = NULL;
mode.context_ewin = NULL;
if (mode.kde_support)
KDE_UpdateFocusedWindow();
}
return;
}
if (ewin) if (ewin)
{ {
if (win != ewin->client.win) if (win != ewin->client.win)
XSetInputFocus(disp, ewin->client.win, RevertToPointerRoot, CurrentTime); XSetInputFocus(disp, ewin->client.win, RevertToPointerRoot, CurrentTime);
mode.focuswin = NULL;
mode.realfocuswin = NULL;
mode.context_ewin = NULL;
if (mode.kde_support)
KDE_UpdateFocusedWindow();
} }
return;
val = 0; val = 0;
data = NULL; data = NULL;
} }

View File

@ -470,6 +470,14 @@ LogoutCB(int val, void *data)
data = NULL; data = NULL;
} }
static void CB_SettingsEscape(int val, void *data);
static void
CB_SettingsEscape(int val, void *data)
{
DialogClose((Dialog *) data);
val = 0;
}
/* This is the original code from actions.c(doExit). */ /* This is the original code from actions.c(doExit). */
void void
doSMExit(void *params) doSMExit(void *params)
@ -584,6 +592,7 @@ doSMExit(void *params)
else if (!strcmp(s, "logout")) else if (!strcmp(s, "logout"))
{ {
Dialog *d; Dialog *d;
EWin *ewin;
AUDIO_PLAY("SOUND_LOGOUT"); AUDIO_PLAY("SOUND_LOGOUT");
d = CreateDialog("LOGOUT_DIALOG"); d = CreateDialog("LOGOUT_DIALOG");
@ -597,7 +606,12 @@ doSMExit(void *params)
); );
DialogAddButton(d, " Yes, Log Out ", LogoutCB, 1); DialogAddButton(d, " Yes, Log Out ", LogoutCB, 1);
DialogAddButton(d, " No ", NULL, 1); DialogAddButton(d, " No ", NULL, 1);
DialogBindKey(d, "Escape", CB_SettingsEscape, 0, d);
DialogBindKey(d, "Return", LogoutCB, 0, d);
ShowDialog(d); ShowDialog(d);
ewin = FindEwinByDialog(d);
if (ewin)
FocusToEWin(ewin);
return; return;
} }
} }
@ -1077,6 +1091,14 @@ SaveSession(int shutdown)
} }
} }
static void CB_SettingsEscape(int val, void *data);
static void
CB_SettingsEscape(int val, void *data)
{
DialogClose((Dialog *) data);
val = 0;
}
/* /*
* Normally, the SM will throw away all the session data for a client * Normally, the SM will throw away all the session data for a client
* that breaks its connection unexpectedly. In order to avoid this we * that breaks its connection unexpectedly. In order to avoid this we
@ -1163,6 +1185,7 @@ doSMExit(void *params)
else if (!strcmp(s, "logout")) else if (!strcmp(s, "logout"))
{ {
Dialog *d; Dialog *d;
EWin *ewin;
d = CreateDialog("LOGOUT_DIALOG"); d = CreateDialog("LOGOUT_DIALOG");
DialogSetTitle(d, "Are you sure?"); DialogSetTitle(d, "Are you sure?");
@ -1175,7 +1198,12 @@ doSMExit(void *params)
); );
DialogAddButton(d, " Yes, Log Out ", LogoutCB, 1); DialogAddButton(d, " Yes, Log Out ", LogoutCB, 1);
DialogAddButton(d, " No ", NULL, 1); DialogAddButton(d, " No ", NULL, 1);
DialogBindKey(d, "Escape", CB_SettingsEscape, 1, d);
DialogBindKey(d, "Return", LogoutCB, 0, d);
ShowDialog(d); ShowDialog(d);
ewin = FindEwinByDialog(d);
if (ewin)
FocusToEWin(ewin);
return; return;
} }
else if (!strcmp(s, "restart_wm")) else if (!strcmp(s, "restart_wm"))