Merge lp:~muktupavels/compiz/gtk-frame-extents into lp:compiz/0.9.13

Proposed by Alberts Muktupāvels on 2017-04-29
Status: Work in progress
Proposed branch: lp:~muktupavels/compiz/gtk-frame-extents
Merge into: lp:compiz/0.9.13
Diff against target: 125 lines (+28/-6)
6 files modified
plugins/grid/src/grid.cpp (+4/-4)
plugins/move/src/move.cpp (+11/-2)
plugins/resize/src/logic/include/window-interface.h (+1/-0)
plugins/resize/src/logic/src/resize-logic.cpp (+6/-0)
plugins/resize/src/window-impl.h (+5/-0)
src/screen.cpp (+1/-0)
To merge this branch: bzr merge lp:~muktupavels/compiz/gtk-frame-extents
Reviewer Review Type Date Requested Status
Compiz Maintainers 2017-04-29 Pending
Review via email: mp+323427@code.launchpad.net
To post a comment you must log in.
p (pino-silvaggio) wrote :

The patch seems to be working for the most part but when any csd application, i.e.: tilix or nautilus is tiled and you refocus the window, the csd window will change size (select another window and then click on the tiled window).

Unmerged revisions

4115. By Alberts Muktupāvels on 2017-04-29

Merge with lp:compiz.

4114. By Alberts Muktupāvels on 2017-04-20

grid: use client frame to adjust window size and position.

4113. By Alberts Muktupāvels on 2017-04-20

resize: remove client frame from resize rectangle

4112. By Alberts Muktupāvels on 2017-04-20

move: remove client frame from move rectangle.

4111. By Alberts Muktupāvels on 2017-04-20

Fix Constrain Y option with CSD windows in move plugin.

4110. By Alberts Muktupāvels on 2017-04-20

Add _GTK_FRAME_EXTENTS to _NET_SUPPORTED.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/grid/src/grid.cpp'
2--- plugins/grid/src/grid.cpp 2016-09-07 11:10:35 +0000
3+++ plugins/grid/src/grid.cpp 2017-04-29 11:57:47 +0000
4@@ -377,10 +377,10 @@
5 desiredRect = constrainSize (cw, desiredSlot);
6 }
7
8- xwc.x = desiredRect.x ();
9- xwc.y = desiredRect.y ();
10- xwc.width = desiredRect.width ();
11- xwc.height = desiredRect.height ();
12+ xwc.x = desiredRect.x () - cw->clientFrame().left;
13+ xwc.y = desiredRect.y () - cw->clientFrame().top;
14+ xwc.width = desiredRect.width () + cw->clientFrame().left + cw->clientFrame().right;
15+ xwc.height = desiredRect.height () + cw->clientFrame().top + cw->clientFrame().bottom;
16
17 /* Store a copy of xwc since configureXWindow changes it's values */
18 XWindowChanges wc = xwc;
19
20=== modified file 'plugins/move/src/move.cpp'
21--- plugins/move/src/move.cpp 2017-04-20 08:03:29 +0000
22+++ plugins/move/src/move.cpp 2017-04-29 11:57:47 +0000
23@@ -386,6 +386,10 @@
24 int width = wWidth + w->border ().left + w->border ().right;
25 int height = w->border ().top ? w->border ().top : 1;
26
27+ x += w->clientFrame ().left;
28+ y += w->clientFrame ().top;
29+ width -= w->clientFrame ().left + w->clientFrame ().right;
30+
31 int status = XRectInRegion (ms->region, x, y,
32 (unsigned int) width,
33 (unsigned int) height);
34@@ -405,7 +409,7 @@
35 if (xStatus != RectangleIn)
36 dx += (dx < 0) ? 1 : -1;
37
38- x = wX + dx - w->border ().left;
39+ x = wX + dx - w->border ().left + w->clientFrame ().left;
40 }
41
42 while (dy && status != RectangleIn)
43@@ -418,7 +422,7 @@
44 if (status != RectangleIn)
45 dy += (dy < 0) ? 1 : -1;
46
47- y = wY + dy - w->border ().top;
48+ y = wY + dy - w->border ().top + w->clientFrame ().top;
49 }
50 }
51 else
52@@ -820,6 +824,11 @@
53 int wY = w->geometry ().y () - w->border ().top;
54 int wWidth = w->geometry ().widthIncBorders () + w->border ().left + w->border ().right;
55 int wHeight = w->geometry ().heightIncBorders () + w->border ().top + w->border ().bottom;
56+
57+ wX += w->clientFrame ().left;
58+ wY += w->clientFrame ().top;
59+ wWidth -= w->clientFrame ().left + w->clientFrame ().right;
60+ wHeight -= w->clientFrame ().top + w->clientFrame ().bottom;
61
62 pBox->x1 = wX + pos_x;
63 pBox->y1 = wY + pos_y;
64
65=== modified file 'plugins/resize/src/logic/include/window-interface.h'
66--- plugins/resize/src/logic/include/window-interface.h 2014-03-11 18:35:18 +0000
67+++ plugins/resize/src/logic/include/window-interface.h 2017-04-29 11:57:47 +0000
68@@ -53,6 +53,7 @@
69 virtual const CompWindow::Geometry & serverGeometry () const = 0;
70 virtual const CompWindowExtents & border () const = 0;
71 virtual const CompWindowExtents & output () const = 0;
72+ virtual const CompWindowExtents & clientFrame () const = 0;
73 virtual bool constrainNewWindowSize (int width,
74 int height,
75 int *newWidth,
76
77=== modified file 'plugins/resize/src/logic/src/resize-logic.cpp'
78--- plugins/resize/src/logic/src/resize-logic.cpp 2016-03-03 14:22:25 +0000
79+++ plugins/resize/src/logic/src/resize-logic.cpp 2017-04-29 11:57:47 +0000
80@@ -638,11 +638,17 @@
81 pBox->x2 = geometry.x + geometry.width +
82 w->serverGeometry ().border () * 2 + w->border ().right;
83
84+ pBox->x1 += w->clientFrame ().left;
85+ pBox->y1 += w->clientFrame ().top;
86+ pBox->x2 -= w->clientFrame ().right;
87+
88 if (w->shaded ())
89 pBox->y2 = geometry.y + w->size ().height () + w->border ().bottom;
90 else
91 pBox->y2 = geometry.y + geometry.height +
92 w->serverGeometry ().border () * 2 + w->border ().bottom;
93+
94+ pBox->y2 -= w->clientFrame ().bottom;
95 }
96
97 void
98
99=== modified file 'plugins/resize/src/window-impl.h'
100--- plugins/resize/src/window-impl.h 2014-03-11 18:35:18 +0000
101+++ plugins/resize/src/window-impl.h 2017-04-29 11:57:47 +0000
102@@ -113,6 +113,11 @@
103 return mImpl->output ();
104 }
105
106+ virtual const CompWindowExtents & clientFrame () const
107+ {
108+ return mImpl->clientFrame ();
109+ }
110+
111 virtual bool constrainNewWindowSize (int width,
112 int height,
113 int *newWidth,
114
115=== modified file 'src/screen.cpp'
116--- src/screen.cpp 2016-07-28 13:43:06 +0000
117+++ src/screen.cpp 2017-04-29 11:57:47 +0000
118@@ -2436,6 +2436,7 @@
119
120 atoms.push_back (Atoms::wmUserTime);
121 atoms.push_back (Atoms::frameExtents);
122+ atoms.push_back (Atoms::frameGtkExtents);
123 atoms.push_back (Atoms::frameWindow);
124
125 atoms.push_back (Atoms::winState);

Subscribers

People subscribed via source and target branches