1 |
pacho 15/06/28 10:33:10 |
2 |
|
3 |
Added: mutter-3.16.2-size-unredirected.patch |
4 |
Log: |
5 |
surface-actor-x11: Make sure to set a size when unredirected (from 3.16 branch). This fixes clicking on stuff in sloppy / mouse mode focus. |
6 |
|
7 |
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key A188FBD4) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 x11-wm/mutter/files/mutter-3.16.2-size-unredirected.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-wm/mutter/files/mutter-3.16.2-size-unredirected.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-wm/mutter/files/mutter-3.16.2-size-unredirected.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: mutter-3.16.2-size-unredirected.patch |
16 |
=================================================================== |
17 |
From 351f444f9d16a90636feb217b15f0f376bf96d85 Mon Sep 17 00:00:00 2001 |
18 |
From: "Jasper St. Pierre" <jstpierre@×××××××.net> |
19 |
Date: Tue, 23 Jun 2015 16:23:45 -0700 |
20 |
Subject: surface-actor-x11: Make sure to set a size when unredirected |
21 |
|
22 |
When we're unredirected, we don't have a pixmap, and thus our allocation |
23 |
becomes 0x0. So when events come in, they pass right through our actor, |
24 |
going to the one underneath in the stack. |
25 |
|
26 |
Fix this by having a fallback size on the shaped texture actor when |
27 |
we're unredirected, causing it to always have a valid allocation. |
28 |
|
29 |
This fixes clicking on stuff in sloppy / mouse mode focus. |
30 |
|
31 |
diff --git a/src/compositor/meta-shaped-texture-private.h b/src/compositor/meta-shaped-texture-private.h |
32 |
index 4ee8027..21c6335 100644 |
33 |
--- a/src/compositor/meta-shaped-texture-private.h |
34 |
+++ b/src/compositor/meta-shaped-texture-private.h |
35 |
@@ -32,6 +32,9 @@ |
36 |
ClutterActor *meta_shaped_texture_new (void); |
37 |
void meta_shaped_texture_set_texture (MetaShapedTexture *stex, |
38 |
CoglTexture *texture); |
39 |
+void meta_shaped_texture_set_fallback_size (MetaShapedTexture *stex, |
40 |
+ guint fallback_width, |
41 |
+ guint fallback_height); |
42 |
gboolean meta_shaped_texture_is_obscured (MetaShapedTexture *self); |
43 |
|
44 |
#endif |
45 |
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c |
46 |
index 163c5e6..8701d1b 100644 |
47 |
--- a/src/compositor/meta-shaped-texture.c |
48 |
+++ b/src/compositor/meta-shaped-texture.c |
49 |
@@ -86,6 +86,7 @@ struct _MetaShapedTexturePrivate |
50 |
cairo_region_t *unobscured_region; |
51 |
|
52 |
guint tex_width, tex_height; |
53 |
+ guint fallback_width, fallback_height; |
54 |
|
55 |
guint create_mipmaps : 1; |
56 |
}; |
57 |
@@ -136,7 +137,20 @@ set_unobscured_region (MetaShapedTexture *self, |
58 |
g_clear_pointer (&priv->unobscured_region, (GDestroyNotify) cairo_region_destroy); |
59 |
if (unobscured_region) |
60 |
{ |
61 |
- cairo_rectangle_int_t bounds = { 0, 0, priv->tex_width, priv->tex_height }; |
62 |
+ guint width, height; |
63 |
+ |
64 |
+ if (priv->texture) |
65 |
+ { |
66 |
+ width = priv->tex_width; |
67 |
+ height = priv->tex_height; |
68 |
+ } |
69 |
+ else |
70 |
+ { |
71 |
+ width = priv->fallback_width; |
72 |
+ height = priv->fallback_height; |
73 |
+ } |
74 |
+ |
75 |
+ cairo_rectangle_int_t bounds = { 0, 0, width, height }; |
76 |
priv->unobscured_region = cairo_region_copy (unobscured_region); |
77 |
cairo_region_intersect_rectangle (priv->unobscured_region, &bounds); |
78 |
} |
79 |
@@ -499,16 +513,21 @@ meta_shaped_texture_get_preferred_width (ClutterActor *self, |
80 |
gfloat *natural_width_p) |
81 |
{ |
82 |
MetaShapedTexturePrivate *priv; |
83 |
+ guint width; |
84 |
|
85 |
g_return_if_fail (META_IS_SHAPED_TEXTURE (self)); |
86 |
|
87 |
priv = META_SHAPED_TEXTURE (self)->priv; |
88 |
|
89 |
- if (min_width_p) |
90 |
- *min_width_p = priv->tex_width; |
91 |
+ if (priv->texture) |
92 |
+ width = priv->tex_width; |
93 |
+ else |
94 |
+ width = priv->fallback_width; |
95 |
|
96 |
+ if (min_width_p) |
97 |
+ *min_width_p = width; |
98 |
if (natural_width_p) |
99 |
- *natural_width_p = priv->tex_width; |
100 |
+ *natural_width_p = width; |
101 |
} |
102 |
|
103 |
static void |
104 |
@@ -518,16 +537,21 @@ meta_shaped_texture_get_preferred_height (ClutterActor *self, |
105 |
gfloat *natural_height_p) |
106 |
{ |
107 |
MetaShapedTexturePrivate *priv; |
108 |
+ guint height; |
109 |
|
110 |
g_return_if_fail (META_IS_SHAPED_TEXTURE (self)); |
111 |
|
112 |
priv = META_SHAPED_TEXTURE (self)->priv; |
113 |
|
114 |
- if (min_height_p) |
115 |
- *min_height_p = priv->tex_height; |
116 |
+ if (priv->texture) |
117 |
+ height = priv->tex_height; |
118 |
+ else |
119 |
+ height = priv->fallback_height; |
120 |
|
121 |
+ if (min_height_p) |
122 |
+ *min_height_p = height; |
123 |
if (natural_height_p) |
124 |
- *natural_height_p = priv->tex_height; |
125 |
+ *natural_height_p = height; |
126 |
} |
127 |
|
128 |
static cairo_region_t * |
129 |
@@ -860,6 +884,17 @@ meta_shaped_texture_get_image (MetaShapedTexture *stex, |
130 |
return surface; |
131 |
} |
132 |
|
133 |
+void |
134 |
+meta_shaped_texture_set_fallback_size (MetaShapedTexture *self, |
135 |
+ guint fallback_width, |
136 |
+ guint fallback_height) |
137 |
+{ |
138 |
+ MetaShapedTexturePrivate *priv = self->priv; |
139 |
+ |
140 |
+ priv->fallback_width = fallback_width; |
141 |
+ priv->fallback_height = fallback_height; |
142 |
+} |
143 |
+ |
144 |
static void |
145 |
meta_shaped_texture_cull_out (MetaCullable *cullable, |
146 |
cairo_region_t *unobscured_region, |
147 |
diff --git a/src/compositor/meta-surface-actor-x11.c b/src/compositor/meta-surface-actor-x11.c |
148 |
index 4aa7ecd..b50b8f2 100644 |
149 |
--- a/src/compositor/meta-surface-actor-x11.c |
150 |
+++ b/src/compositor/meta-surface-actor-x11.c |
151 |
@@ -416,6 +416,7 @@ meta_surface_actor_x11_set_size (MetaSurfaceActorX11 *self, |
152 |
int width, int height) |
153 |
{ |
154 |
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self); |
155 |
+ MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self)); |
156 |
|
157 |
if (priv->last_width == width && |
158 |
priv->last_height == height) |
159 |
@@ -424,4 +425,5 @@ meta_surface_actor_x11_set_size (MetaSurfaceActorX11 *self, |
160 |
priv->size_changed = TRUE; |
161 |
priv->last_width = width; |
162 |
priv->last_height = height; |
163 |
+ meta_shaped_texture_set_fallback_size (stex, width, height); |
164 |
} |
165 |
-- |
166 |
cgit v0.10.2 |