Hello community,
here is the log from the commit of package compiz
checked in at Mon May 15 12:44:32 CEST 2006.
--------
--- compiz/compiz.changes 2006-05-08 03:39:40.000000000 +0200
+++ STABLE/compiz/compiz.changes 2006-05-14 14:02:01.000000000 +0200
@@ -1,0 +2,24 @@
+Sun May 14 13:58:01 CEST 2006 - dreveman@suse.de
+
+- Fix issue that caused some windows to not be unmapped
+ correctly. Most noticeable on tooltips.
+
+-------------------------------------------------------------------
+Fri May 12 15:03:33 CEST 2006 - dreveman@suse.de
+
+- Make sure window is mapped when getting the window pixmap.
+ (bnc 173248)
+- Fix placement issues with maximized windows.
+- Allow click on window decorations to trigger window action menu.
+- Don't show window action menu on desktop and dock windows.
+- Fix issue with unmaximizing initially maximized windows.
+- Fix a server grab issue that could cause windows to get added
+ twice.
+- Handle North and West gravity correctly for ConfigureRequest.
+- Fix some issues with moving windows into withdrawn state.
+- Don't show windows that request to not be in tasklists in
+ switcher.
+- Only go into show desktop mode when some window is covering the
+ desktop.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ compiz.spec ++++++
--- /var/tmp/diff_new_pack.cVrCZd/_old 2006-05-15 12:44:13.000000000 +0200
+++ /var/tmp/diff_new_pack.cVrCZd/_new 2006-05-15 12:44:13.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package compiz (Version cvs_060507)
+# spec file for package compiz (Version cvs_060514)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -17,8 +17,8 @@
PreReq: %fillup_prereq
Requires: libpng libdrm gconf2 gtk2 gnome-desktop control-center2 libsvg libsvg-cairo libwnck
Autoreqprov: on
-Version: cvs_060507
-Release: 4
+Version: cvs_060514
+Release: 1
Summary: OpenGL window and compositing manager.
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 x86_64 ppc ppc64 ia64
@@ -135,6 +135,24 @@
/etc/opt/gnome/gconf/schemas/compiz.schemas
%changelog -n compiz
+* Sun May 14 2006 - dreveman@suse.de
+- Fix issue that caused some windows to not be unmapped
+ correctly. Most noticeable on tooltips.
+* Fri May 12 2006 - dreveman@suse.de
+- Make sure window is mapped when getting the window pixmap.
+ (bnc 173248)
+- Fix placement issues with maximized windows.
+- Allow click on window decorations to trigger window action menu.
+- Don't show window action menu on desktop and dock windows.
+- Fix issue with unmaximizing initially maximized windows.
+- Fix a server grab issue that could cause windows to get added
+ twice.
+- Handle North and West gravity correctly for ConfigureRequest.
+- Fix some issues with moving windows into withdrawn state.
+- Don't show windows that request to not be in tasklists in
+ switcher.
+- Only go into show desktop mode when some window is covering the
+ desktop.
* Mon May 08 2006 - danw@suse.de
- Add xgl-settings-options.diff to patch out some not-quite-working
code in xgl-settings.
++++++ compiz-0.0.10.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/ChangeLog new/compiz-0.0.10/ChangeLog
--- old/compiz-0.0.10/ChangeLog 2006-05-07 23:39:14.000000000 +0200
+++ new/compiz-0.0.10/ChangeLog 2006-05-14 13:34:48.000000000 +0200
@@ -1,3 +1,87 @@
+2006-05-14 David Reveman
+
+ * src/event.c (handleEvent): mapNum might be 0 if we found the window
+ unmapped when trying to bind it to a texture.
+
+2006-05-12 David Reveman
+
+ * src/screen.c (enterShowDesktopMode): Only go into show desktop mode
+ when some window is being hidden.
+
+ * src/event.c (handleWindowDamageRect): Make sure placed is set to true
+ when no plugin is doing placement.
+ (handleEvent): Don't set WM_STATE on override redirect windows.
+
+ * plugins/switcher.c (isSwitchWin): Don't show windows that ask not to
+ be in tasklists.
+
+ * plugins/rotate.c (rotateHandleEvent): Only adjust viewport if window
+ has been placed.
+
+ * plugins/minimize.c (minHandleEvent): Reset everything when going
+ into withdrawn state.
+
+ * src/window.c (moveResizeWindow): Handle west and north gravity
+ correctly.
+
+2006-05-11 David Reveman
+
+ * src/display.c (addDisplay):
+ * src/screen.c (addScreen): Move server grab to addDisplay to make
+ sure that no windows are created between XSelectInput and XQueryTree
+ as that would result in them being added two times.
+
+ * src/window.c (moveResizeWindow): Fix typo, CWY should be CWX.
+ (moveResizeWindow): Constrain Y position so that window titlebar is
+ visible.
+ (restoreWindowGeometry): Fix issue with going from maximized state
+ to non-maximized state without changing the window size.
+
+ * gnome/window-decorator/gnome-window-decorator.c
+ (max_window_name_width): Make sure title text fit in titlebar.
+
+2006-05-11 Dan Winship
+
+ * plugins/gconf-compiz-utils.c (gconfStringToBinding): Treat "" as
+ meaning "disabled"
+
+2006-05-11 David Reveman
+
+ * gnome/window-decorator/gnome-window-decorator.c (action_menu_map):
+ Don't show window action menu on desktop and dock windows.
+
+ * src/event.c (handleEvent): Allow click on window decorations
+ to trigger window action menu.
+
+ * plugins/place.c (placeWindow): Place fullscreen and maximized
+ windows correctly.
+ (placeWindow): Only clip dialog position to screen if parent is
+ visible in current viewport.
+
+2006-05-09 David Reveman
+
+ * plugins/switcher.c (switchPaintThumb): Rearrange code so we handle
+ the case when bindWindow fails.
+
+ * src/paint.c (paintWindow): Bail out if window is not mapped.
+
+ * src/window.c (bindWindow): Make sure window is mapped when
+ getting the window pixmap. (bnc 173248)
+
+ * plugins/compiz.schemas.in.in: Regen.
+
+ * plugins/cube.c (CUBE_MIPMAP_DEFAULT): Enable by default as
+ performance seem to be OK now when new mipmaps are only generated
+ when necessary.
+
+ * src/texture.c (enableTexture): Don't generate new mipmaps
+ every time the texture is used.
+
+2006-05-08 David Reveman
+
+ * plugins/switcher.c: Allow switcher to be initiated with prev
+ bindings. (Quinn Storm)
+
2006-05-07 David Reveman
* plugins/compiz.schemas.in.in: Regen.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/gnome/window-decorator/gnome-window-decorator.c new/compiz-0.0.10/gnome/window-decorator/gnome-window-decorator.c
--- old/compiz-0.0.10/gnome/window-decorator/gnome-window-decorator.c 2006-05-07 01:43:38.000000000 +0200
+++ new/compiz-0.0.10/gnome/window-decorator/gnome-window-decorator.c 2006-05-11 18:14:26.000000000 +0200
@@ -2408,7 +2408,7 @@
if (d->name)
pango_layout_set_text (d->layout, d->name, strlen (d->name));
- return w + 4;
+ return w + 6;
}
static void
@@ -3587,6 +3587,22 @@
gtk_widget_destroy (action_menu);
}
+ switch (wnck_window_get_window_type (win)) {
+ case WNCK_WINDOW_DESKTOP:
+ case WNCK_WINDOW_DOCK:
+ /* don't allow window action */
+ return;
+ case WNCK_WINDOW_NORMAL:
+ case WNCK_WINDOW_DIALOG:
+ case WNCK_WINDOW_MODAL_DIALOG:
+ case WNCK_WINDOW_TOOLBAR:
+ case WNCK_WINDOW_MENU:
+ case WNCK_WINDOW_UTILITY:
+ case WNCK_WINDOW_SPLASHSCREEN:
+ /* allow window action menu */
+ break;
+ }
+
action_menu = wnck_create_window_action_menu (win);
gtk_menu_set_screen (GTK_MENU (action_menu), screen);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/plugins/compiz.schemas.in.in new/compiz-0.0.10/plugins/compiz.schemas.in.in
--- old/compiz-0.0.10/plugins/compiz.schemas.in.in 2006-05-07 23:38:44.000000000 +0200
+++ new/compiz-0.0.10/plugins/compiz.schemas.in.in 2006-05-09 17:57:25.000000000 +0200
@@ -983,7 +983,7 @@
<applyto>/apps/compiz/plugins/cube/screen0/options/mipmap</applyto>
<owner>compiz</owner>
<type>bool</type>
- <default>false</default>
+ <default>true</default>
<locale name="C">
<short>Mipmap</short>
<long>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/plugins/cube.c new/compiz-0.0.10/plugins/cube.c
--- old/compiz-0.0.10/plugins/cube.c 2006-05-02 23:19:43.000000000 +0200
+++ new/compiz-0.0.10/plugins/cube.c 2006-05-09 17:54:10.000000000 +0200
@@ -85,7 +85,7 @@
#define CUBE_TIMESTEP_MAX 50.0f
#define CUBE_TIMESTEP_PRECISION 0.1f
-#define CUBE_MIPMAP_DEFAULT FALSE
+#define CUBE_MIPMAP_DEFAULT TRUE
static int displayPrivateIndex;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/plugins/gconf-compiz-utils.c new/compiz-0.0.10/plugins/gconf-compiz-utils.c
--- old/compiz-0.0.10/plugins/gconf-compiz-utils.c 2006-04-28 15:45:34.000000000 +0200
+++ new/compiz-0.0.10/plugins/gconf-compiz-utils.c 2006-05-11 18:09:10.000000000 +0200
@@ -109,7 +109,7 @@
gint i;
guint mods = 0;
- if (strcasecmp (binding, "disabled") == 0)
+ if (strcasecmp (binding, "disabled") == 0 || !*binding)
{
value->bind.type = CompBindingTypeNone;
return TRUE;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/plugins/minimize.c new/compiz-0.0.10/plugins/minimize.c
--- old/compiz-0.0.10/plugins/minimize.c 2006-05-02 22:33:41.000000000 +0200
+++ new/compiz-0.0.10/plugins/minimize.c 2006-05-12 13:20:15.000000000 +0200
@@ -570,11 +570,18 @@
{
MIN_WINDOW (w);
- if (mw->state == IconicState)
+ if (mw->adjust)
{
+ mw->adjust = FALSE;
+ mw->xScale = mw->yScale = 1.0f;
+ mw->tx = mw->ty = 0.0f;
+ mw->xVelocity = mw->yVelocity = 0.0f;
+ mw->xScaleVelocity = mw->yScaleVelocity = 1.0f;
+
(*w->screen->setWindowScale) (w, 1.0f, 1.0f);
- mw->state = NormalState;
}
+
+ mw->state = NormalState;
}
}
default:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/plugins/place.c new/compiz-0.0.10/plugins/place.c
--- old/compiz-0.0.10/plugins/place.c 2006-05-01 22:29:36.000000000 +0200
+++ new/compiz-0.0.10/plugins/place.c 2006-05-12 13:07:17.000000000 +0200
@@ -701,6 +701,24 @@
break;
}
+ if (window->type & CompWindowTypeFullscreenMask)
+ {
+ x = y = 0;
+ goto done_no_constraints;
+ }
+
+ if (window->state & (CompWindowStateMaximizedVertMask |
+ CompWindowStateMaximizedHorzMask))
+ {
+ if (window->state & CompWindowStateMaximizedVertMask)
+ y = window->screen->workArea.y + window->input.top;
+
+ if (window->state & CompWindowStateMaximizedHorzMask)
+ x = window->screen->workArea.x + window->input.left;
+
+ goto done;
+ }
+
if (ps->opt[PLACE_SCREEN_OPTION_WORKAROUND].value.b)
{
/* workarounds enabled */
@@ -758,8 +776,7 @@
window->transientFor);
if (parent)
{
- int w;
- XRectangle area;
+ int w;
x = parent->attrib.x;
y = parent->attrib.y;
@@ -780,19 +797,23 @@
/* put top of child's frame, not top of child's client */
y += window->input.top;
- /* clip to screen */
- area = parent->screen->workArea;
+ /* clip to screen if parent is visible in current viewport */
+ if (parent->attrib.x < parent->screen->width &&
+ parent->attrib.x + parent->screen->width > 0)
+ {
+ XRectangle area = parent->screen->workArea;
- if (x + window->width > area.x + area.width)
- x = area.x + area.width - window->width;
- if (y + window->height > area.y + area.height)
- y = area.y + area.height - window->height;
- if (x < area.x) x = area.x;
- if (y < area.y) y = area.y;
+ if (x + window->width > area.x + area.width)
+ x = area.x + area.width - window->width;
+ if (y + window->height > area.y + area.height)
+ y = area.y + area.height - window->height;
+ if (x < area.x) x = area.x;
+ if (y < area.y) y = area.y;
+ }
avoid_being_obscured_as_second_modal_dialog (window, &x, &y);
- goto done;
+ goto done_no_x_constraints;
}
}
@@ -929,6 +950,7 @@
if (x - window->input.left < window->screen->workArea.x)
x = window->screen->workArea.x + window->input.left;
+done_no_x_constraints:
if (y + window->height + window->input.bottom >
window->screen->workArea.y + window->screen->workArea.height)
y = window->screen->workArea.y + window->screen->workArea.height
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/plugins/rotate.c new/compiz-0.0.10/plugins/rotate.c
--- old/compiz-0.0.10/plugins/rotate.c 2006-05-07 16:22:21.000000000 +0200
+++ new/compiz-0.0.10/plugins/rotate.c 2006-05-12 13:52:25.000000000 +0200
@@ -1183,6 +1183,10 @@
s = w->screen;
+ /* window must be placed */
+ if (!w->placed)
+ break;
+
if (otherScreenGrabExist (s, "rotate", "switcher", "cube", 0))
break;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/plugins/switcher.c new/compiz-0.0.10/plugins/switcher.c
--- old/compiz-0.0.10/plugins/switcher.c 2006-05-07 16:25:26.000000000 +0200
+++ new/compiz-0.0.10/plugins/switcher.c 2006-05-12 11:42:58.000000000 +0200
@@ -550,7 +550,7 @@
if (!(ss->wMask & w->type))
return FALSE;
- if (w->state & CompWindowStateSkipPagerMask)
+ if (w->state & CompWindowStateSkipTaskbarMask)
return FALSE;
if (!ss->allWindows)
@@ -1041,9 +1041,11 @@
if (!ss->switching)
{
if (eventMatches (d, event,
- &ss->opt[SWITCH_SCREEN_OPTION_INITIATE]))
+ &ss->opt[SWITCH_SCREEN_OPTION_INITIATE]) ||
+ eventMatches (d, event, &ss->prev_bind))
switchInitiate (s, FALSE);
- else if (eventMatches (d, event, &ss->init_all_bind))
+ else if (eventMatches (d, event, &ss->init_all_bind) ||
+ eventMatches (d, event, &ss->prev_all_bind))
switchInitiate (s, TRUE);
}
@@ -1389,6 +1391,12 @@
if (w->mapNum)
{
+ if (!w->texture.pixmap)
+ bindWindow (w);
+ }
+
+ if (w->mapNum)
+ {
SWITCH_SCREEN (w->screen);
width = WIDTH - (SPACE << 1);
@@ -1415,9 +1423,6 @@
wx = x + SPACE + ((WIDTH - (SPACE << 1)) - width) / 2;
wy = y + SPACE + ((HEIGHT - (SPACE << 1)) - height) / 2;
- if (!w->texture.pixmap)
- bindWindow (w);
-
dx = wx - w->attrib.x;
dy = wy - w->attrib.y;
@@ -1801,6 +1806,8 @@
addScreenBinding (s, &ss->opt[SWITCH_SCREEN_OPTION_INITIATE].value.bind);
addScreenBinding (s, &ss->init_all_bind.value.bind);
+ addScreenBinding (s, &ss->prev_bind.value.bind);
+ addScreenBinding (s, &ss->prev_all_bind.value.bind);
WRAP (ss, s, preparePaintScreen, switchPreparePaintScreen);
WRAP (ss, s, donePaintScreen, switchDonePaintScreen);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/src/display.c new/compiz-0.0.10/src/display.c
--- old/compiz-0.0.10/src/display.c 2006-05-06 13:23:23.000000000 +0200
+++ new/compiz-0.0.10/src/display.c 2006-05-11 20:12:11.000000000 +0200
@@ -2003,6 +2003,8 @@
continue;
}
+ XGrabServer (dpy);
+
XSelectInput (dpy, XRootWindow (dpy, i),
SubstructureRedirectMask |
SubstructureNotifyMask |
@@ -2021,6 +2023,7 @@
"already running on screen: %d\n",
programName, i);
+ XUngrabServer (dpy);
continue;
}
@@ -2037,6 +2040,8 @@
lastPointerX = pointerX = x;
lastPointerY = pointerY = y;
}
+
+ XUngrabServer (dpy);
}
if (!d->screens)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/src/event.c new/compiz-0.0.10/src/event.c
--- old/compiz-0.0.10/src/event.c 2006-05-07 19:48:44.000000000 +0200
+++ new/compiz-0.0.10/src/event.c 2006-05-14 13:15:45.000000000 +0200
@@ -72,6 +72,9 @@
if (initial)
damageWindowOutputExtents (w);
}
+
+ if (!w->attrib.override_redirect)
+ w->placed = TRUE;
}
void
@@ -341,7 +344,9 @@
updateClientListForScreen (w->screen);
}
- setWmState (d, WithdrawnState, w->id);
+ if (!w->attrib.override_redirect)
+ setWmState (d, WithdrawnState, w->id);
+
w->placed = FALSE;
}
@@ -475,12 +480,16 @@
if (eventMatches (d, event,
&d->opt[COMP_DISPLAY_OPTION_WINDOW_MENU]))
{
- toolkitAction (s, s->display->toolkitActionWindowMenuAtom,
- event->xbutton.time,
- event->xbutton.window,
- event->xbutton.button,
- event->xbutton.x_root,
- event->xbutton.y_root);
+ w = findTopLevelWindowAtScreen (s, event->xbutton.window);
+ if (w)
+ toolkitAction (s,
+ s->display->toolkitActionWindowMenuAtom,
+ event->xbutton.time,
+ w->id,
+ event->xbutton.button,
+ event->xbutton.x_root,
+ event->xbutton.y_root);
+
eventMode = AsyncPointer;
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/src/paint.c new/compiz-0.0.10/src/paint.c
--- old/compiz-0.0.10/src/paint.c 2006-04-28 00:40:35.000000000 +0200
+++ new/compiz-0.0.10/src/paint.c 2006-05-09 14:06:28.000000000 +0200
@@ -775,7 +775,11 @@
}
if (!w->texture.pixmap)
+ {
bindWindow (w);
+ if (!w->mapNum)
+ return FALSE;
+ }
w->vCount = 0;
(*w->screen->addWindowGeometry) (w, &w->matrix, 1, w->region, region);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/src/screen.c new/compiz-0.0.10/src/screen.c
--- old/compiz-0.0.10/src/screen.c 2006-05-07 16:28:02.000000000 +0200
+++ new/compiz-0.0.10/src/screen.c 2006-05-12 13:33:13.000000000 +0200
@@ -1479,8 +1479,6 @@
detectRefreshRateOfScreen (s);
- XGrabServer (dpy);
-
XQueryTree (dpy, s->root,
&rootReturn, &parentReturn,
&children, &nchildren);
@@ -1503,8 +1501,6 @@
}
}
- XUngrabServer (dpy);
-
XFree (children);
attrib.override_redirect = 1;
@@ -2657,6 +2653,7 @@
{
CompWindow *w;
unsigned long data = 1;
+ int count = 0;
s->showingDesktopMask = ~(CompWindowTypeDesktopMask |
CompWindowTypeDockMask);
@@ -2671,6 +2668,15 @@
hideWindow (w);
}
}
+
+ if (w->inShowDesktopMode)
+ count++;
+ }
+
+ if (!count)
+ {
+ s->showingDesktopMask = 0;
+ data = 0;
}
XChangeProperty (s->display->display, s->root,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/src/texture.c new/compiz-0.0.10/src/texture.c
--- old/compiz-0.0.10/src/texture.c 2006-05-06 22:24:52.000000000 +0200
+++ new/compiz-0.0.10/src/texture.c 2006-05-09 17:51:37.000000000 +0200
@@ -402,7 +402,10 @@
if (texture->filter == GL_LINEAR_MIPMAP_LINEAR)
{
if (texture->oldMipmaps)
+ {
(*screen->generateMipmap) (texture->target);
+ texture->oldMipmaps = FALSE;
+ }
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/compiz-0.0.10/src/window.c new/compiz-0.0.10/src/window.c
--- old/compiz-0.0.10/src/window.c 2006-05-07 02:55:50.000000000 +0200
+++ new/compiz-0.0.10/src/window.c 2006-05-12 13:05:12.000000000 +0200
@@ -858,14 +858,24 @@
if (!w->pixmap)
{
- w->pixmap =
- XCompositeNameWindowPixmap (w->screen->display->display,
- w->id);
- if (!w->pixmap)
- {
- fprintf (stderr, "%s: XCompositeNameWindowPixmap failed\n",
- programName);
+ XWindowAttributes attr;
+
+ /* We have to grab the server here to make sure that window
+ is mapped when getting the window pixmap */
+ XGrabServer (w->screen->display->display);
+ XGetWindowAttributes (w->screen->display->display, w->id, &attr);
+ if (attr.map_state != IsViewable)
+ {
+ XUngrabServer (w->screen->display->display);
+ finiTexture (w->screen, &w->texture);
+ w->mapNum = 0;
+ return;
}
+
+ w->pixmap = XCompositeNameWindowPixmap (w->screen->display->display,
+ w->id);
+
+ XUngrabServer (w->screen->display->display);
}
if (!bindPixmapToTexture (w->screen, &w->texture, w->pixmap,
@@ -1808,14 +1818,6 @@
{
pixmap = XCompositeNameWindowPixmap (w->screen->display->display,
w->id);
- if (!pixmap)
- {
- fprintf (stderr, "%s: XCompositeNameWindowPixmap failed\n",
- programName);
-
- return FALSE;
- }
-
result = XGetGeometry (w->screen->display->display, pixmap, &root,
&i, &i, &actualWidth, &actualHeight,
&ui, &ui);
@@ -2102,11 +2104,12 @@
if (xwcm & (CWX | CWWidth))
{
- switch (gravity)
- {
+ switch (gravity) {
case NorthWestGravity:
case WestGravity:
case SouthWestGravity:
+ if (xwcm & CWX)
+ xwc->x += w->input.left;
break;
case NorthGravity:
@@ -2119,8 +2122,9 @@
case NorthEastGravity:
case EastGravity:
case SouthEastGravity:
- xwc->x -= w->input.right;
- if (!(xwcm & CWY))
+ if (xwcm & CWX)
+ xwc->x -= w->input.right;
+ else
xwc->x += w->attrib.width - xwc->width;
break;
@@ -2134,11 +2138,12 @@
if (xwcm & (CWY | CWHeight))
{
- switch (gravity)
- {
+ switch (gravity) {
case NorthWestGravity:
case NorthGravity:
case NorthEastGravity:
+ if (xwcm & CWY)
+ xwc->y += w->input.top;
break;
case WestGravity:
@@ -2151,8 +2156,9 @@
case SouthWestGravity:
case SouthGravity:
case SouthEastGravity:
- xwc->y -= w->input.bottom;
- if (!(xwcm & CWY))
+ if (xwcm & CWY)
+ xwc->y -= w->input.bottom;
+ else
xwc->y += w->attrib.height - xwc->height;
break;
@@ -2164,6 +2170,19 @@
xwcm |= CWY;
}
+ if (xwcm & CWY)
+ {
+ int min, max;
+
+ min = w->screen->workArea.y + w->input.top;
+ max = w->screen->workArea.y + w->screen->workArea.height;
+
+ if (xwc->y < min)
+ xwc->y = min;
+ else if (xwc->y > max)
+ xwc->y = max;
+ }
+
if (xwcm & CWBorderWidth)
{
if (xwc->border_width == w->attrib.border_width)
@@ -2640,11 +2659,35 @@
xwc->y = w->saveWc.y;
if (m & CWWidth)
+ {
xwc->width = w->saveWc.width;
+ /* This is not perfect but it works OK for now. If the saved width is
+ the same as the current width then make it a little be smaller so
+ the user can see that it changed and it also makes sure that
+ windowResizeNotify is called and plugins are notified. */
+ if (xwc->width == w->attrib.width)
+ {
+ xwc->width -= 10;
+ if (m & CWX)
+ xwc->x += 5;
+ }
+ }
+
if (m & CWHeight)
+ {
xwc->height = w->saveWc.height;
+ /* As above, if the saved height is the same as the current height
+ then make it a little be smaller. */
+ if (xwc->height == w->attrib.height)
+ {
+ xwc->height -= 10;
+ if (m & CWY)
+ xwc->y += 5;
+ }
+ }
+
if (m & CWBorderWidth)
xwc->border_width = w->saveWc.border_width;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...