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

Fix some bugs, DisableMiniwindows, _KWM_WIN_ICON_GEOMETRY..

This commit is contained in:
kojima
1999-03-18 01:11:18 +00:00
parent 67a008937f
commit ea55bc5e3f
24 changed files with 658 additions and 274 deletions

View File

@@ -313,7 +313,9 @@ typedef struct WPreferences {
char dont_confirm_kill; /* do not confirm Kill application */
char dont_blink;
char disable_miniwindows;
char dont_blink; /* do not blink icon selection */
/* Appearance options */
char new_style; /* Use newstyle buttons */

View File

@@ -916,11 +916,13 @@ wIconifyWindow(WWindow *wwin)
ButtonMotionMask|ButtonReleaseMask, GrabModeAsync,
GrabModeAsync, None, None, CurrentTime);
}
if (!wwin->flags.icon_moved) {
PlaceIcon(wwin->screen_ptr, &wwin->icon_x, &wwin->icon_y);
if (!wPreferences.disable_miniwindows) {
if (!wwin->flags.icon_moved) {
PlaceIcon(wwin->screen_ptr, &wwin->icon_x, &wwin->icon_y);
}
wwin->icon = wIconCreate(wwin);
}
wwin->icon = wIconCreate(wwin);
wwin->flags.miniaturized = 1;
wwin->flags.mapped = 0;
@@ -939,28 +941,58 @@ wIconifyWindow(WWindow *wwin)
/* let all Expose events arrive so that we can repaint
* something before the animation starts (and the server is grabbed) */
XSync(dpy, 0);
wClientSetState(wwin, IconicState, wwin->icon->icon_win);
if (wPreferences.disable_miniwindows)
wClientSetState(wwin, IconicState, None);
else
wClientSetState(wwin, IconicState, wwin->icon->icon_win);
flushExpose();
#ifdef ANIMATIONS
if (!wwin->screen_ptr->flags.startup && !wwin->flags.skip_next_animation
&& !wPreferences.no_animations) {
int ix, iy, iw, ih;
if (!wPreferences.disable_miniwindows) {
ix = wwin->icon_x;
iy = wwin->icon_y;
iw = wwin->icon->core->width;
ih = wwin->icon->core->height;
} else {
WArea area;
if (wKWMGetIconGeometry(wwin, &area)) {
ix = area.x1;
iy = area.y1;
iw = area.x2 - ix;
ih = area.y2 - iy;
} else {
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,
wwin->icon_x, wwin->icon_y,
wwin->icon->core->width, wwin->icon->core->height,
False);
ix, iy, iw, ih, False);
}
#endif
}
wwin->flags.skip_next_animation = 0;
if (wwin->screen_ptr->current_workspace==wwin->frame->workspace ||
IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)
XMapWindow(dpy, wwin->icon->core->window);
AddToStackList(wwin->icon->core);
if (!wPreferences.disable_miniwindows) {
wLowerFrame(wwin->icon->core);
if (wwin->screen_ptr->current_workspace==wwin->frame->workspace ||
IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)
XMapWindow(dpy, wwin->icon->core->window);
AddToStackList(wwin->icon->core);
wLowerFrame(wwin->icon->core);
}
if (present) {
WWindow *owner = recursiveTransientFor(wwin->screen_ptr->focused_window);
@@ -1001,8 +1033,8 @@ wIconifyWindow(WWindow *wwin)
#endif
}
if (wwin->flags.selected)
if (wwin->flags.selected && !wPreferences.disable_miniwindows)
wIconSelect(wwin->icon);
#ifdef GNOME_STUFF
@@ -1014,10 +1046,11 @@ wIconifyWindow(WWindow *wwin)
#endif
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
}
void
wDeiconifyWindow(WWindow *wwin)
{
@@ -1042,10 +1075,12 @@ wDeiconifyWindow(WWindow *wwin)
if (!wwin->flags.shaded)
wwin->flags.mapped = 1;
if (wwin->icon->selected)
wIconSelect(wwin->icon);
if (!wPreferences.disable_miniwindows) {
if (wwin->icon->selected)
wIconSelect(wwin->icon);
XUnmapWindow(dpy, wwin->icon->core->window);
XUnmapWindow(dpy, wwin->icon->core->window);
}
#ifdef WMSOUND
wSoundPlay(WMSOUND_DEICONIFY);
@@ -1053,11 +1088,32 @@ wDeiconifyWindow(WWindow *wwin)
/* if the window is in another workspace, do it silently */
#ifdef ANIMATIONS
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations
&& !wwin->flags.skip_next_animation) {
animateResize(wwin->screen_ptr, wwin->icon_x, wwin->icon_y,
wwin->icon->core->width, wwin->icon->core->height,
wwin->frame_x, wwin->frame_y,
int ix, iy, iw, ih;
if (!wPreferences.disable_miniwindows) {
ix = wwin->icon_x;
iy = wwin->icon_y;
iw = wwin->icon->core->width;
ih = wwin->icon->core->height;
} else {
WArea area;
if (wKWMGetIconGeometry(wwin, &area)) {
ix = area.x1;
iy = area.y1;
iw = area.x2 - ix;
ih = area.y2 - iy;
} else {
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,
wwin->frame->core->width, wwin->frame->core->height,
False);
}
@@ -1073,11 +1129,13 @@ wDeiconifyWindow(WWindow *wwin)
wClientSetState(wwin, NormalState, None);
}
mapTransientsFor(wwin);
RemoveFromStackList(wwin->icon->core);
/* removeIconGrabs(wwin->icon);*/
wIconDestroy(wwin->icon);
wwin->icon = NULL;
if (!wPreferences.disable_miniwindows) {
RemoveFromStackList(wwin->icon->core);
/* removeIconGrabs(wwin->icon);*/
wIconDestroy(wwin->icon);
wwin->icon = NULL;
}
XUngrabServer(dpy);
if (wPreferences.focus_mode==WKF_CLICK
|| wPreferences.focus_mode==WKF_SLOPPY)
@@ -1116,7 +1174,6 @@ static void
hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate)
{
if (wwin->flags.miniaturized) {
/* XXX wrong fix, can cause side effects, must remove 'if' */
if (wwin->icon) {
XUnmapWindow(dpy, wwin->icon->core->window);
wwin->icon->mapped = 0;

View File

@@ -714,7 +714,7 @@ wClientGetNormalHints(WWindow *wwin, XWindowAttributes *wattribs, Bool geometry,
wwin->normal_hints->min_width = wwin->normal_hints->max_width;
}
if (/*pre_icccm && */!wwin->screen_ptr->flags.startup && geometry) {
if (pre_icccm && !wwin->screen_ptr->flags.startup && geometry) {
#ifdef DEBUG
printf("PRE ICCCM\n");
#endif

View File

@@ -268,32 +268,35 @@ static WOptionEnumeration seIconPositions[] = {
WDefaultEntry staticOptionList[] = {
{"DisableDithering", "NO", NULL,
&wPreferences.no_dithering, getBool, NULL
&wPreferences.no_dithering, getBool, NULL
},
{"ColormapSize", "4", NULL,
&wPreferences.cmap_size, getInt, NULL
&wPreferences.cmap_size, getInt, NULL
},
/* static by laziness */
{"IconSize", "64", NULL,
&wPreferences.icon_size, getInt, NULL
&wPreferences.icon_size, getInt, NULL
},
{"ModifierKey", "Mod1", NULL,
&wPreferences.modifier_mask, getModMask, NULL
&wPreferences.modifier_mask, getModMask, NULL
},
{"DisableWSMouseActions", "NO", NULL,
&wPreferences.disable_root_mouse, getBool, NULL
&wPreferences.disable_root_mouse, getBool, NULL
},
{"FocusMode", "manual", seFocusModes,
&wPreferences.focus_mode, getEnum, NULL
&wPreferences.focus_mode, getEnum, NULL
}, /* have a problem when switching from manual to sloppy without restart */
{"NewStyle", "NO", NULL,
&wPreferences.new_style, getBool, NULL
&wPreferences.new_style, getBool, NULL
},
{"DisableDock", "NO", (void*) WM_DOCK,
NULL, getBool, setIfDockPresent
NULL, getBool, setIfDockPresent
},
{"DisableClip", "NO", (void*) WM_CLIP,
NULL, getBool, setIfDockPresent
NULL, getBool, setIfDockPresent
},
{"DisableMiniwindows", "NO", NULL,
&wPreferences.disable_miniwindows, getBool, NULL
}
};

View File

@@ -759,7 +759,7 @@ wIconPaint(WIcon *icon)
int l;
int w;
tmp = ShrinkString(scr->icon_title_font, icon->icon_name,
tmp = ShrinkString(scr->icon_title_font, icon->icon_name,
wPreferences.icon_size-4);
w = wTextWidth(scr->icon_title_font->font, tmp, l=strlen(tmp));

View File

@@ -178,6 +178,8 @@ static Atom _XA_KWM_WIN_ICONIFIED = 0;
static Atom _XA_KWM_WIN_MAXIMIZED = 0;
static Atom _XA_KWM_WIN_STICKY = 0;
static Atom _XA_KWM_WIN_ICON_GEOMETRY = 0;
static Atom _XA_KWM_CURRENT_DESKTOP = 0;
static Atom _XA_KWM_NUMBER_OF_DESKTOPS = 0;
static Atom _XA_KWM_DESKTOP_NAME_[MAX_WORKSPACES];
@@ -558,6 +560,9 @@ wKWMInitStuff(WScreen *scr)
_XA_KWM_WIN_MAXIMIZED = XInternAtom(dpy, "KWM_WIN_MAXIMIZED", False);
_XA_KWM_WIN_ICON_GEOMETRY = XInternAtom(dpy, "KWM_WIN_ICON_GEOMETRY",
False);
_XA_KWM_COMMAND = XInternAtom(dpy, "KWM_COMMAND", False);
_XA_KWM_ACTIVE_WINDOW = XInternAtom(dpy, "KWM_ACTIVE_WINDOW", False);
@@ -1517,6 +1522,15 @@ wKWMGetUsableArea(WScreen *scr, WArea *area)
}
Bool
wKWMGetIconGeometry(WWindow *wwin, WArea *area)
{
return getAreaHint(wwin->client_win, _XA_KWM_WIN_ICON_GEOMETRY, area);
}
#ifdef not_used
void
wKWMSetUsableAreaHint(WScreen *scr, int workspace)

View File

@@ -93,5 +93,7 @@ void wKWMBroadcastStacking(WScreen *scr);
char *wKWMGetWorkspaceName(WScreen *scr, int workspace);
Bool wKWMGetIconGeometry(WWindow *wwin, WArea *area);
#endif