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
=== modified file 'plugins/scale/scale.xml.in'
--- plugins/scale/scale.xml.in 2011-09-19 13:00:51 +0000
+++ plugins/scale/scale.xml.in 2012-01-15 23:31:25 +0000
@@ -15,6 +15,13 @@
15 <options>15 <options>
16 <group>16 <group>
17 <_short>Appearance</_short>17 <_short>Appearance</_short>
18 <option name="left_padding" type="int">
19 <_short>Left padding</_short>
20 <_long>Left padding</_long>
21 <default>64</default>
22 <min>0</min>
23 <max>250</max>
24 </option>
18 <option name="spacing" type="int">25 <option name="spacing" type="int">
19 <_short>Spacing</_short>26 <_short>Spacing</_short>
20 <_long>Space between windows</_long>27 <_long>Space between windows</_long>
2128
=== modified file 'plugins/scale/src/scale.cpp'
--- plugins/scale/src/scale.cpp 2011-10-21 15:20:26 +0000
+++ plugins/scale/src/scale.cpp 2012-01-15 23:31:25 +0000
@@ -440,12 +440,14 @@
440 int x, y, width, height;440 int x, y, width, height;
441 int lines, n, nSlots;441 int lines, n, nSlots;
442 int spacing;442 int spacing;
443 int left_padding;
443444
444 if (!nWindows)445 if (!nWindows)
445 return;446 return;
446447
447 lines = sqrt (nWindows + 1);448 lines = sqrt (nWindows + 1);
448 spacing = optionGetSpacing ();449 spacing = optionGetSpacing ();
450 left_padding = optionGetLeftPadding ();
449 nSlots = 0;451 nSlots = 0;
450452
451 y = workArea.y () + spacing;453 y = workArea.y () + spacing;
@@ -455,8 +457,8 @@
455 {457 {
456 n = MIN (nWindows - nSlots, ceilf ((float) nWindows / lines));458 n = MIN (nWindows - nSlots, ceilf ((float) nWindows / lines));
457459
458 x = workArea.x () + spacing;460 x = workArea.x () + left_padding + spacing;
459 width = (workArea.width () - (n + 1) * spacing) / n;461 width = (workArea.width () - left_padding - (n + 1) * spacing) / n;
460462
461 for (j = 0; j < n; j++)463 for (j = 0; j < n; j++)
462 {464 {
@@ -1052,6 +1054,8 @@
1052bool1054bool
1053PrivateScaleScreen::ensureDndRedirectWindow ()1055PrivateScaleScreen::ensureDndRedirectWindow ()
1054{1056{
1057 int left_padding = optionGetLeftPadding ();
1058
1055 if (!dndTarget)1059 if (!dndTarget)
1056 {1060 {
1057 XSetWindowAttributes attr;1061 XSetWindowAttributes attr;
@@ -1071,7 +1075,7 @@
1071 }1075 }
10721076
1073 XMoveResizeWindow (screen->dpy (), dndTarget,1077 XMoveResizeWindow (screen->dpy (), dndTarget,
1074 0, 0, screen->width (), screen->height ());1078 left_padding, 0, screen->width () - left_padding, screen->height ());
1075 XMapRaised (screen->dpy (), dndTarget);1079 XMapRaised (screen->dpy (), dndTarget);
10761080
1077 return true;1081 return true;

Subscribers

People subscribed via source and target branches