Merge lp:~azzar1/compiz-core/scale-left-padding into lp:compiz-core/0.9.5

Proposed by Andrea Azzarone
Status: Rejected
Rejected by: Sam Spilsbury
Proposed branch: lp:~azzar1/compiz-core/scale-left-padding
Merge into: lp:compiz-core/0.9.5
Diff against target: 65 lines (+14/-3)
2 files modified
plugins/scale/scale.xml.in (+7/-0)
plugins/scale/src/scale.cpp (+7/-3)
To merge this branch: bzr merge lp:~azzar1/compiz-core/scale-left-padding
Reviewer Review Type Date Requested Status
Sam Spilsbury Needs Information
Review via email: mp+88622@code.launchpad.net

Description of the change

Add a left padding option to the scale plugin. We really need it to fix the bug #893670.
Using the padding to create the dnd redirect window will fix also the bug #727904.

To post a comment you must log in.
2912. By Andrea Azzarone

Ops

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

The scale plugin needs tests, but thats outside the scope of this merge review

review: Approve
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

OK, I did some thinking about this and this comes back to an idea I've had for a while but not yet had time to implement.

We need to have a concept of "overlay struts" in the EWMH or our own extension to it, eg _COMPIZ_NET_OVERLAY_STRUT. Such "struts" allow us to specify parts of the screen which are never available for output operations. That way the scale, expo and other plugins would be able to adjust all layouts to compensate for this lack of screen space on screen-level operations.

_COMPIZ_IS_NET_OVERLAY would be a property on any window which also sets _NET_WM_STRUT or _NET_WM_STRUT_PARTIAL which basically indicates that the area is reserved for both window and screen level operations. So the scale plugin would adjust its layout and dnd window accordingly

review: Needs Information
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Now that we are using overlay struts, this is redundant

Unmerged revisions

2912. By Andrea Azzarone

Ops

2911. By Andrea Azzarone

Add a left padding option to the scale plugin.

2910. By Daniel van Vugt

Fix 'make install' failing to install headers properly (LP: #915186)

2909. By Daniel van Vugt

Fix warnings due to signed/unsigned int comparison in CompTimer. (LP: #893998)
Merged: lp:~smspillaz/compiz-core/fix-timer-warnings-893998
without any of its prereqs.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/scale/scale.xml.in'
2--- plugins/scale/scale.xml.in 2011-09-19 13:00:51 +0000
3+++ plugins/scale/scale.xml.in 2012-01-15 23:31:25 +0000
4@@ -15,6 +15,13 @@
5 <options>
6 <group>
7 <_short>Appearance</_short>
8+ <option name="left_padding" type="int">
9+ <_short>Left padding</_short>
10+ <_long>Left padding</_long>
11+ <default>64</default>
12+ <min>0</min>
13+ <max>250</max>
14+ </option>
15 <option name="spacing" type="int">
16 <_short>Spacing</_short>
17 <_long>Space between windows</_long>
18
19=== modified file 'plugins/scale/src/scale.cpp'
20--- plugins/scale/src/scale.cpp 2011-10-21 15:20:26 +0000
21+++ plugins/scale/src/scale.cpp 2012-01-15 23:31:25 +0000
22@@ -440,12 +440,14 @@
23 int x, y, width, height;
24 int lines, n, nSlots;
25 int spacing;
26+ int left_padding;
27
28 if (!nWindows)
29 return;
30
31 lines = sqrt (nWindows + 1);
32 spacing = optionGetSpacing ();
33+ left_padding = optionGetLeftPadding ();
34 nSlots = 0;
35
36 y = workArea.y () + spacing;
37@@ -455,8 +457,8 @@
38 {
39 n = MIN (nWindows - nSlots, ceilf ((float) nWindows / lines));
40
41- x = workArea.x () + spacing;
42- width = (workArea.width () - (n + 1) * spacing) / n;
43+ x = workArea.x () + left_padding + spacing;
44+ width = (workArea.width () - left_padding - (n + 1) * spacing) / n;
45
46 for (j = 0; j < n; j++)
47 {
48@@ -1052,6 +1054,8 @@
49 bool
50 PrivateScaleScreen::ensureDndRedirectWindow ()
51 {
52+ int left_padding = optionGetLeftPadding ();
53+
54 if (!dndTarget)
55 {
56 XSetWindowAttributes attr;
57@@ -1071,7 +1075,7 @@
58 }
59
60 XMoveResizeWindow (screen->dpy (), dndTarget,
61- 0, 0, screen->width (), screen->height ());
62+ left_padding, 0, screen->width () - left_padding, screen->height ());
63 XMapRaised (screen->dpy (), dndTarget);
64
65 return true;

Subscribers

People subscribed via source and target branches