SHA256
1
0
forked from pool/xfwm4

Accepting request 87379 from X11:xfce

- added xfwm4-4.8.2-careful-layer-manipulation.patch in order to
  ignore size increment if a resize request comes from an
  application itself (backported from upstream git)
- added xfwm4-4.8.2-fix-resizing.patch in oder to be more careful
  when allowing applications to manipulate the window layer by
  themselves
- do not package INSTALL file

OBS-URL: https://build.opensuse.org/request/show/87379
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xfwm4?expand=0&rev=37
This commit is contained in:
Lars Vogdt 2011-10-11 16:00:30 +00:00 committed by Git OBS Bridge
commit c9670d9804
4 changed files with 455 additions and 1 deletions

View File

@ -0,0 +1,99 @@
From 9015305a2e4f46a938b88f0029c19db26657c0ad Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan@xfce.org>
Date: Mon, 10 Oct 2011 08:33:03 +0000
Subject: Some apps that I wouldn't name try to manipulate the win layer by
themselves and cause havoc when doing so on transient dialogs, so
we need to be extra careful before allowing apps to change the
layer.
---
diff --git a/src/client.c b/src/client.c
index 67c5f36..e5e56ca 100644
--- a/src/client.c
+++ b/src/client.c
@@ -983,6 +983,7 @@ clientGetMWMHints (Client * c, gboolean update)
&& !FLAG_TEST(c->flags, CLIENT_FLAG_FULLSCREEN))
{
/* legacy app changed its decoration, put it back on regular layer */
+ TRACE ("Legacy app changed its decoration \"%s\" (0x%lx)", c->name, c->window);
FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_LEGACY_FULLSCREEN);
clientSetLayer (c, WIN_LAYER_NORMAL);
}
@@ -1834,7 +1835,7 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture)
(c->win_layer == WIN_LAYER_NORMAL) &&
(c->type == WINDOW_NORMAL))
{
- g_print ("Full screen for old apps\n");
+ TRACE ("Fullscreen for old apps \"%s\" (0x%lx)", c->name, c->window);
FLAG_SET (c->xfwm_flags, XFWM_FLAG_LEGACY_FULLSCREEN);
}
@@ -2730,7 +2731,7 @@ clientSetLayer (Client * c, guint l)
Client *c2 = NULL;
g_return_if_fail (c != NULL);
- TRACE ("entering clientSetLayer");
+ TRACE ("entering clientSetLayer for \"%s\" (0x%lx) on layer %d", c->name, c->window, l);
screen_info = c->screen_info;
display_info = screen_info->display_info;
diff --git a/src/events.c b/src/events.c
index f3aadcf..e1f9588 100644
--- a/src/events.c
+++ b/src/events.c
@@ -1982,7 +1982,13 @@ handleClientMessage (DisplayInfo *display_info, XClientMessageEvent * ev)
else if ((ev->message_type == display_info->atoms[WIN_LAYER]) && (ev->format == 32))
{
TRACE ("client \"%s\" (0x%lx) has received a WIN_LAYER event", c->name, c->window);
- if ((unsigned long) ev->data.l[0] != c->win_layer)
+ /*
+ * Some apps that I wouldn't name try to manipulate the win layer by themselves
+ * and cause havoc when doing so on transient dialogs, so we need to be extra careful
+ * here before allowing apps to change the layer.
+ * Actually, I beleive twe should get rid of support of this old protocol...
+ */
+ if (!clientIsTransientOrModal(c) && ((unsigned long) ev->data.l[0] != c->win_layer))
{
clientSetLayer (c, ev->data.l[0]);
}
diff --git a/src/stacking.c b/src/stacking.c
index c299d74..180ea61 100644
--- a/src/stacking.c
+++ b/src/stacking.c
@@ -544,6 +544,9 @@ clientAdjustFullscreenLayer (Client *c, gboolean set)
{
g_return_val_if_fail (c, FALSE);
+ TRACE ("entering clientAdjustFullscreenLayer");
+ TRACE ("Adjusting fullscreen layer for \"%s\" (0x%lx)", c->name, c->window);
+
if (set)
{
if (FLAG_TEST(c->xfwm_flags, XFWM_FLAG_LEGACY_FULLSCREEN)
@@ -555,17 +558,16 @@ clientAdjustFullscreenLayer (Client *c, gboolean set)
}
else if (c->win_layer == WIN_LAYER_FULLSCREEN)
{
- if (FLAG_TEST(c->xfwm_flags, XFWM_FLAG_LEGACY_FULLSCREEN)
- || FLAG_TEST(c->flags, CLIENT_FLAG_FULLSCREEN))
+ if (FLAG_TEST(c->flags, CLIENT_FLAG_FULLSCREEN))
{
- if (FLAG_TEST(c->flags, CLIENT_FLAG_FULLSCREEN))
- {
- clientSetLayer (c, c->fullscreen_old_layer);
- }
- else
- {
- clientSetLayer (c, WIN_LAYER_NORMAL);
- }
+ TRACE ("Moving \"%s\" (0x%lx) to initial layer %d", c->name, c->window, c->fullscreen_old_layer);
+ clientSetLayer (c, c->fullscreen_old_layer);
+ return TRUE;
+ }
+ if (FLAG_TEST(c->xfwm_flags, XFWM_FLAG_LEGACY_FULLSCREEN))
+ {
+ TRACE ("Moving \"%s\" (0x%lx) to layer %d", c->name, c->window, WIN_LAYER_FULLSCREEN);
+ clientSetLayer (c, WIN_LAYER_NORMAL);
return TRUE;
}
}

View File

@ -0,0 +1,338 @@
From 41ce9e6b77ce2b601cc6cec46d29a6c59cebde82 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan@xfce.org>
Date: Fri, 07 Oct 2011 13:19:41 +0000
Subject: Do not enforce the size increment only if the size request comes
from the application itself (refix bug #7445)
---
diff --git a/src/client.c b/src/client.c
index 64bd2e7..67c5f36 100644
--- a/src/client.c
+++ b/src/client.c
@@ -666,11 +666,11 @@ clientConfigure (Client * c, XWindowChanges * wc, unsigned long mask, unsigned s
}
if (mask & CWWidth)
{
- c->width = wc->width;
+ clientSetWidth (c, wc->width, flags & CFG_REQUEST);
}
if (mask & CWHeight)
{
- c->height = wc->height;
+ clientSetHeight (c, wc->height, flags & CFG_REQUEST);
}
if (mask & CWBorderWidth)
{
@@ -1834,6 +1834,7 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture)
(c->win_layer == WIN_LAYER_NORMAL) &&
(c->type == WINDOW_NORMAL))
{
+ g_print ("Full screen for old apps\n");
FLAG_SET (c->xfwm_flags, XFWM_FLAG_LEGACY_FULLSCREEN);
}
diff --git a/src/moveresize.c b/src/moveresize.c
index 0ee9ebf..0653ffa 100644
--- a/src/moveresize.c
+++ b/src/moveresize.c
@@ -77,48 +77,48 @@ struct _MoveResizeData
};
static void
-clientComputeWidth (Client * c, int *w)
+clientSetSize (Client * c, int *size, int size_min, int size_max, int size_inc, gboolean source_is_application)
{
- int w2;
+ int temp;
g_return_if_fail (c != NULL);
- g_return_if_fail (w != NULL);
- TRACE ("entering clientComputeWidth");
+ g_return_if_fail (size != NULL);
+ TRACE ("entering clientSetSize");
/* Bypass resize increment and max sizes for fullscreen */
if (!FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)
&& !(FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED)
&& (c->screen_info->params->borderless_maximize)))
{
- if ((c->size->flags & PResizeInc) && (c->size->width_inc))
+ if (!source_is_application && (c->size->flags & PResizeInc) && (size_inc))
{
- w2 = (*w - c->size->min_width) / c->size->width_inc;
- *w = c->size->min_width + (w2 * c->size->width_inc);
+ temp = (*size - size_min) / size_inc;
+ *size = size_min + (temp * size_inc);
}
if (c->size->flags & PMaxSize)
{
- if (*w > c->size->max_width)
+ if (*size > size_max)
{
- *w = c->size->max_width;
+ *size = size_max;
}
}
}
if (c->size->flags & PMinSize)
{
- if (*w < c->size->min_width)
+ if (*size < size_min)
{
- *w = c->size->min_width;
+ *size = size_min;
}
}
- if (*w < 1)
+ if (*size < 1)
{
- *w = 1;
+ *size = 1;
}
}
void
-clientSetWidth (Client * c, int w)
+clientSetWidth (Client * c, int w, gboolean source_is_application)
{
int temp;
@@ -127,52 +127,12 @@ clientSetWidth (Client * c, int w)
TRACE ("setting width %i for client \"%s\" (0x%lx)", w, c->name, c->window);
temp = w;
- clientComputeWidth (c, &temp);
+ clientSetSize (c, &temp, c->size->min_width, c->size->max_width, c->size->width_inc, source_is_application);
c->width = temp;
}
-static void
-clientComputeHeight (Client * c, int *h)
-{
- int h2;
-
- g_return_if_fail (c != NULL);
- TRACE ("entering clientComputeHeight");
-
- /* Bypass resize increment and max sizes for fullscreen */
- if (!FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)
- && !(FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED)
- && (c->screen_info->params->borderless_maximize)))
- {
- if ((c->size->flags & PResizeInc) && (c->size->height_inc))
- {
- h2 = (*h - c->size->min_height) / c->size->height_inc;
- *h = c->size->min_height + (h2 * c->size->height_inc);
- }
- if (c->size->flags & PMaxSize)
- {
- if (*h > c->size->max_height)
- {
- *h = c->size->max_height;
- }
- }
- }
-
- if (c->size->flags & PMinSize)
- {
- if (*h < c->size->min_height)
- {
- *h = c->size->min_height;
- }
- }
- if (*h < 1)
- {
- *h = 1;
- }
-}
-
void
-clientSetHeight (Client * c, int h)
+clientSetHeight (Client * c, int h, gboolean source_is_application)
{
int temp;
@@ -181,7 +141,7 @@ clientSetHeight (Client * c, int h)
TRACE ("setting height %i for client \"%s\" (0x%lx)", h, c->name, c->window);
temp = h;
- clientComputeHeight (c, &temp);
+ clientSetSize (c, &temp, c->size->min_height, c->size->max_height, c->size->height_inc, source_is_application);
c->height = temp;
}
@@ -273,7 +233,7 @@ clientSetHandle(MoveResizeData *passdata, int handle)
#define MAKE_MULT(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) )
static void
-clientConstrainRatio (Client * c, int *w, int *h, int handle)
+clientConstrainRatio (Client * c, int handle)
{
g_return_if_fail (c != NULL);
@@ -291,59 +251,59 @@ clientConstrainRatio (Client * c, int *w, int *h, int handle)
maxx = c->size->max_aspect.x;
maxy = c->size->max_aspect.y;
- if ((minx * *h > miny * *w) && (miny) &&
+ if ((minx * c->height > miny * c->width) && (miny) &&
((handle == CORNER_COUNT + SIDE_TOP) || (handle == CORNER_COUNT + SIDE_BOTTOM)))
{
/* Change width to match */
- delta = MAKE_MULT (minx * *h / miny - *w, xinc);
+ delta = MAKE_MULT (minx * c->height / miny - c->width, xinc);
if (!(c->size->flags & PMaxSize) ||
- (*w + delta <= c->size->max_width))
+ (c->width + delta <= c->size->max_width))
{
- *w += delta;
+ c->width += delta;
}
}
- if ((minx * *h > miny * *w) && (minx))
+ if ((minx * c->height > miny * c->width) && (minx))
{
- delta = MAKE_MULT (*h - *w * miny / minx, yinc);
+ delta = MAKE_MULT (c->height - c->width * miny / minx, yinc);
if (!(c->size->flags & PMinSize) ||
- (*h - delta >= c->size->min_height))
+ (c->height - delta >= c->size->min_height))
{
- *h -= delta;
+ c->height -= delta;
}
else
{
- delta = MAKE_MULT (minx * *h / miny - *w, xinc);
+ delta = MAKE_MULT (minx * c->height / miny - c->width, xinc);
if (!(c->size->flags & PMaxSize) ||
- (*w + delta <= c->size->max_width))
- *w += delta;
+ (c->width + delta <= c->size->max_width))
+ c->width += delta;
}
}
- if ((maxx * *h < maxy * *w) && (maxx) &&
+ if ((maxx * c->height < maxy * c->width) && (maxx) &&
((handle == CORNER_COUNT + SIDE_LEFT) || (handle == CORNER_COUNT + SIDE_RIGHT)))
{
- delta = MAKE_MULT (*w * maxy / maxx - *h, yinc);
+ delta = MAKE_MULT (c->width * maxy / maxx - c->height, yinc);
if (!(c->size->flags & PMaxSize) ||
- (*h + delta <= c->size->max_height))
+ (c->height + delta <= c->size->max_height))
{
- *h += delta;
+ c->height += delta;
}
}
- if ((maxx * *h < maxy * *w) && (maxy))
+ if ((maxx * c->height < maxy * c->width) && (maxy))
{
- delta = MAKE_MULT (*w - maxx * *h / maxy, xinc);
+ delta = MAKE_MULT (c->width - maxx * c->height / maxy, xinc);
if (!(c->size->flags & PMinSize) ||
- (*w - delta >= c->size->min_width))
+ (c->width - delta >= c->size->min_width))
{
- *w -= delta;
+ c->width -= delta;
}
else
{
- delta = MAKE_MULT (*w * maxy / maxx - *h, yinc);
+ delta = MAKE_MULT (c->width * maxy / maxx - c->height, yinc);
if (!(c->size->flags & PMaxSize) ||
- (*h + delta <= c->size->max_height))
+ (c->height + delta <= c->size->max_height))
{
- *h += delta;
+ c->height += delta;
}
}
}
@@ -1427,9 +1387,9 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
c->height = clientFindClosestEdgeY (c, c->y + c->height + frameBottom (c)) - c->y - frameBottom (c);
}
}
- clientConstrainRatio (c, &c->width, &c->height, passdata->handle);
+ clientConstrainRatio (c, passdata->handle);
- clientSetWidth (c, c->width);
+ clientSetWidth (c, c->width, FALSE);
if (move_left)
{
c->x = c->x - (c->width - passdata->oldw);
@@ -1442,7 +1402,7 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
frame_x = frameX (c);
}
- clientSetHeight (c, c->height);
+ clientSetHeight (c, c->height, FALSE);
if (!FLAG_TEST (c->flags, CLIENT_FLAG_SHADED) && move_top)
{
c->y = c->y - (c->height - passdata->oldh);
@@ -1463,14 +1423,14 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
temp = c->y + c->height;
c->y = CLAMP (c->y, screen_info->margins [STRUTS_TOP] + frame_top,
MAX (disp_max_y - min_visible, screen_info->height - screen_info->margins [STRUTS_BOTTOM] - min_visible));
- clientSetHeight (c, temp - c->y);
+ clientSetHeight (c, temp - c->y, FALSE);
c->y = temp - c->height;
}
else if (frame_y < 0)
{
temp = c->y + c->height;
c->y = frame_top;
- clientSetHeight (c, temp - c->y);
+ clientSetHeight (c, temp - c->y, FALSE);
c->y = temp - c->height;
}
}
@@ -1479,7 +1439,7 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
if (c->y + c->height < MAX (disp_y + min_visible, screen_info->margins [STRUTS_TOP] + min_visible))
{
temp = MAX (disp_y + min_visible, screen_info->margins [STRUTS_TOP] + min_visible);
- clientSetHeight (c, temp - c->y);
+ clientSetHeight (c, temp - c->y, FALSE);
}
}
if (move_left)
@@ -1488,7 +1448,7 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
{
temp = c->x + c->width;
c->x = MIN (disp_max_x - min_visible, screen_info->width - screen_info->margins [STRUTS_RIGHT] - min_visible);
- clientSetWidth (c, temp - c->x);
+ clientSetWidth (c, temp - c->x, FALSE);
c->x = temp - c->width;
}
}
@@ -1497,7 +1457,7 @@ clientResizeEventFilter (XEvent * xevent, gpointer data)
if (c->x + c->width < MAX (disp_x + min_visible, screen_info->margins [STRUTS_LEFT] + min_visible))
{
temp = MAX (disp_x + min_visible, screen_info->margins [STRUTS_LEFT] + min_visible);
- clientSetWidth (c, temp - c->x);
+ clientSetWidth (c, temp - c->x, FALSE);
}
}
diff --git a/src/moveresize.h b/src/moveresize.h
index cd5c770..f6ffc9b 100644
--- a/src/moveresize.h
+++ b/src/moveresize.h
@@ -34,9 +34,11 @@
#ifndef INC_MOVERESIZE_H
#define INC_MOVERESIZE_H
void clientSetWidth (Client *,
- int);
+ int,
+ gboolean);
void clientSetHeight (Client *,
- int);
+ int,
+ gboolean);
void clientMove (Client *,
XEvent *);
void clientResize (Client *,

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue Oct 11 11:48:45 UTC 2011 - gber@opensuse.org
- added xfwm4-4.8.2-careful-layer-manipulation.patch in order to
ignore size increment if a resize request comes from an
application itself (backported from upstream git)
- added xfwm4-4.8.2-fix-resizing.patch in oder to be more careful
when allowing applications to manipulate the window layer by
themselves
- do not package INSTALL file
-------------------------------------------------------------------
Fri Oct 7 13:05:10 UTC 2011 - gber@opensuse.org

View File

@ -30,6 +30,10 @@ Source2: COPYING.Sonar
Source3: Gilouche-xfwm4.tar.bz2
Source4: COPYING.Gilouche
Source5: xfwm4.xml
# PATCH-FIX-UPSTREAM xfwm4-4.8.2-fix-resizing.patch bxo#7445 gber@opensuse.org -- Ignore size increment if a resize request comes from an application itself (backported from upstream git)
Patch0: xfwm4-4.8.2-fix-resizing.patch
# PATCH-FIX-UPSTREAM xfwm4-4.8.2-careful-layer-manipulation.patch gber@opensuse.org -- Be more careful when allowing applications to manipulate the window layer by themselves
Patch1: xfwm4-4.8.2-careful-layer-manipulation.patch
BuildRequires: fdupes
BuildRequires: intltool
BuildRequires: pkgconfig(gtk+-2.0)
@ -72,6 +76,8 @@ This package provides the upstream look and feel for the xfwm4 window manager.
%prep
%setup -q -a1 -a3
%patch0 -p1
%patch1 -p1
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
@ -85,7 +91,7 @@ make %{?_smp_mflags} V=1
%make_install
find Gilouche Sonar -depth -print | cpio -pvd %{buildroot}%{_datadir}/themes
install -p -m 644 example.gtkrc-2.0 README COPYING* AUTHORS COMPOSITOR \
ChangeLog INSTALL TODO %{buildroot}%{_defaultdocdir}/%{name}
ChangeLog TODO %{buildroot}%{_defaultdocdir}/%{name}
install -D -p -m 644 %{SOURCE5} \
%{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
%suse_update_desktop_file xfce-wm-settings