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

- Fixed incorrect focusing of application's windows after an unhide (sometimes

the incorrect window got focus instead of the apps's last focused window)
- Unshade application's shaded windows when Dbl-MiddleClick-ing its appicon.
  (this is to be consistent with deminiaturizing application's miniwindows
  which also happens in this case, since shading is a form of miniaturization)
- misc fixes
This commit is contained in:
dan
2003-02-11 00:32:17 +00:00
parent e54a0954e6
commit b381674375
6 changed files with 70 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
Changes since version 0.80.1:
Changes since version 0.80.2:
.............................
- Some updates to WINGs WMConnection. See WINGs/ChangeLog for details.
@@ -43,6 +43,17 @@ Changes since version 0.80.1:
- Fixed a problem in the stacking code which could lead to segmentation faults
(Jeff Teunissen <deek@d2dc.net>)
- Fixed a crashing bug in the menu code when modal panel are involved.
- Fixed incorrect focusing of application's windows after an unhide (sometimes
the incorrect window got focus instead of the apps's last focused window)
- Unshade application's shaded windows when Dbl-MiddleClick-ing its appicon.
(this is to be consistent with deminiaturizing application's miniwindows
which also happens in this case, since shading is a form of miniaturization)
Changes since version 0.80.1:
.............................
- Fixed a buffer overflow when allocating an RImage struct.
Changes since version 0.80.0:

View File

@@ -1362,12 +1362,14 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS)
WWindow *wlist, *next;
WWindow *focused=NULL;
if (!wapp) {
if (!wapp)
return;
}
scr = wapp->main_window_desc->screen_ptr;
wlist = scr->focused_window;
if (!wlist) return;
if (!wlist)
return;
/* goto beginning of list */
while (wlist->prev)
wlist = wlist->prev;
@@ -1381,23 +1383,32 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS)
else if (!focused || !focused->flags.focused)
focused = wlist;
if (wlist->flags.miniaturized && wlist->icon) {
if (bringToCurrentWS || wPreferences.sticky_icons
|| wlist->frame->workspace == scr->current_workspace) {
if (!wlist->icon->mapped) {
if (wlist->flags.miniaturized) {
if (bringToCurrentWS || wPreferences.sticky_icons ||
wlist->frame->workspace == scr->current_workspace) {
if (wlist->icon && !wlist->icon->mapped) {
XMapWindow(dpy, wlist->icon->core->window);
wlist->icon->mapped = 1;
}
wlist->flags.hidden = 0;
WMPostNotificationName(WMNChangedState, wlist, "hide");
if (wlist->frame->workspace != scr->current_workspace)
wWindowChangeWorkspace(wlist, scr->current_workspace);
}
if (miniwindows) {
if (bringToCurrentWS)
wWindowChangeWorkspace(wlist, scr->current_workspace);
wlist->flags.hidden = 0;
if (miniwindows &&
wlist->frame->workspace == scr->current_workspace) {
wDeiconifyWindow(wlist);
}
WMPostNotificationName(WMNChangedState, wlist, "hide");
} else if (wlist->flags.shaded) {
if (bringToCurrentWS)
wWindowChangeWorkspace(wlist, scr->current_workspace);
wlist->flags.hidden = 0;
if (miniwindows &&
wlist->frame->workspace == scr->current_workspace) {
wUnshadeWindow(wlist);
wRaiseFrame(wlist->frame->core);
}
WMPostNotificationName(WMNChangedState, wlist, "hide");
} else if (wlist->flags.hidden) {
unhideWindow(wapp->app_icon->icon, wapp->app_icon->x_pos,
wapp->app_icon->y_pos, wlist,
@@ -1417,10 +1428,12 @@ wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurrentWS)
wapp->flags.skip_next_animation = 0;
wapp->flags.hidden = 0;
if (focused)
wSetFocusTo(scr, focused);
else if (wapp->last_focused && wapp->last_focused->flags.mapped)
if (wapp->last_focused && wapp->last_focused->flags.mapped) {
wRaiseFrame(wapp->last_focused->frame->core);
wSetFocusTo(scr, wapp->last_focused);
} else if (focused) {
wSetFocusTo(scr, focused);
}
wapp->last_focused = NULL;
if (wPreferences.auto_arrange_icons) {
wArrangeIcons(scr, True);
@@ -1678,8 +1691,11 @@ wMakeWindowVisible(WWindow *wwin)
WApplication *app;
app = wApplicationOf(wwin->main_window);
if (app)
if (app) {
/* trick to get focus to this window */
app->last_focused = wwin;
wUnhideApplication(app, False, False);
}
} else if (wwin->flags.miniaturized) {
wDeiconifyWindow(wwin);
} else {

View File

@@ -120,8 +120,6 @@ char *FindImage(char *paths, char *file);
RImage*wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
int IsEof(FILE * stream); /* feof that stats pipes */
void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
char *where);

View File

@@ -949,18 +949,6 @@ ExpandOptions(WScreen *scr, char *cmdline)
}
/* feof doesn't seem to work on pipes */
int
IsEof(FILE * stream)
{
static struct stat stinfo;
fstat(fileno(stream), &stinfo);
return ((S_ISFIFO(stinfo.st_dev) && stinfo.st_size == 0) ||
feof(stream));
}
void
ParseWindowName(WMPropList *value, char **winstance, char **wclass, char *where)
{

View File

@@ -1094,7 +1094,7 @@ parseCascade(WScreen *scr, WMenu *menu, FILE *file, char *file_name)
char params[MAXLINE];
char *line;
while (!IsEof(file)) {
while (!feof(file)) {
int lsize, ok;
ok = 0;
@@ -1120,7 +1120,7 @@ parseCascade(WScreen *scr, WMenu *menu, FILE *file, char *file_name)
} else {
ok=1;
}
} while (!ok && !IsEof(file));
} while (!ok && !feof(file));
if (ok==2)
continue;
@@ -1214,7 +1214,7 @@ readMenuFile(WScreen *scr, char *file_name)
}
}
while (!IsEof(file)) {
while (!feof(file)) {
if (!fgets(linebuf, MAXLINE, file))
break;
line = cropline(linebuf);
@@ -1317,7 +1317,7 @@ readMenuPipe(WScreen *scr, char **file_name)
}
}
while (!IsEof(file)) {
while (!feof(file)) {
if (!fgets(linebuf, MAXLINE, file))
break;
line = cropline(linebuf);