Merge lp:~3v1n0/compiz/resize-selective-grab into lp:compiz/0.9.12

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 3936
Merged at revision: 3985
Proposed branch: lp:~3v1n0/compiz/resize-selective-grab
Merge into: lp:compiz/0.9.12
Prerequisite: lp:~3v1n0/compiz/move-selective-grab
Diff against target: 84 lines (+24/-3)
4 files modified
plugins/resize/src/logic/include/screen-interface.h (+2/-0)
plugins/resize/src/logic/src/resize-logic.cpp (+10/-3)
plugins/resize/src/logic/tests/mock-screen.h (+2/-0)
plugins/resize/src/screen-impl.h (+10/-0)
To merge this branch: bzr merge lp:~3v1n0/compiz/resize-selective-grab
Reviewer Review Type Date Requested Status
MC Return Approve
Andrea Azzarone Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+271589@code.launchpad.net

Commit message

Resize: remember the type of movement and use the proper grabbing for it

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
3934. By Marco Trevisan (Treviño)

Merge with parent lp:~3v1n0/compiz/push-grab-types

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
3935. By Marco Trevisan (Treviño)

Merging with parent branch (lp:~3v1n0/compiz/move-selective-grab)

3936. By Marco Trevisan (Treviño)

Resize: only grab pointer in the case we had a mouse initialization

Otherwise we still need mouse grabbing. Remove type variable, we can be smarter.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM.

review: Approve
Revision history for this message
MC Return (mc-return) wrote :

Also nice. :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/resize/src/logic/include/screen-interface.h'
--- plugins/resize/src/logic/include/screen-interface.h 2013-01-08 09:17:25 +0000
+++ plugins/resize/src/logic/include/screen-interface.h 2015-10-09 15:46:30 +0000
@@ -56,6 +56,8 @@
56 virtual bool otherGrabExist (const char *, void *) = 0;56 virtual bool otherGrabExist (const char *, void *) = 0;
57 virtual void updateGrab (CompScreen::GrabHandle handle, Cursor cursor) = 0;57 virtual void updateGrab (CompScreen::GrabHandle handle, Cursor cursor) = 0;
58 virtual CompScreen::GrabHandle pushGrab (Cursor cursor, const char *name) = 0;58 virtual CompScreen::GrabHandle pushGrab (Cursor cursor, const char *name) = 0;
59 virtual CompScreen::GrabHandle pushPointerGrab (Cursor cursor, const char *name) = 0;
60 virtual CompScreen::GrabHandle pushKeyboardGrab (const char *name) = 0;
59 virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer) = 0;61 virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer) = 0;
6062
61 /* CompOption::Class */63 /* CompOption::Class */
6264
=== modified file 'plugins/resize/src/logic/src/resize-logic.cpp'
--- plugins/resize/src/logic/src/resize-logic.cpp 2015-03-19 15:14:55 +0000
+++ plugins/resize/src/logic/src/resize-logic.cpp 2015-10-09 15:46:30 +0000
@@ -139,7 +139,7 @@
139 case ClientMessage:139 case ClientMessage:
140 if (event->xclient.message_type == Atoms::wmMoveResize)140 if (event->xclient.message_type == Atoms::wmMoveResize)
141 {141 {
142 unsigned long type = event->xclient.data.l[2];142 unsigned long type = event->xclient.data.l[2];
143143
144 if (type <= WmMoveResizeSizeLeft ||144 if (type <= WmMoveResizeSizeLeft ||
145 type == WmMoveResizeSizeKeyboard)145 type == WmMoveResizeSizeKeyboard)
@@ -161,7 +161,7 @@
161 CompOption::TypeBool));161 CompOption::TypeBool));
162 o[1].value ().set (true);162 o[1].value ().set (true);
163163
164 if (event->xclient.data.l[2] == WmMoveResizeSizeKeyboard)164 if (type == WmMoveResizeSizeKeyboard)
165 {165 {
166 initiateResizeDefaultMode (&options->optionGetInitiateKey (),166 initiateResizeDefaultMode (&options->optionGetInitiateKey (),
167 CompAction::StateInitKey,167 CompAction::StateInitKey,
@@ -1331,7 +1331,14 @@
1331 else1331 else
1332 cursor = cursorFromResizeMask (mask);1332 cursor = cursorFromResizeMask (mask);
13331333
1334 grabIndex = mScreen->pushGrab (cursor, "resize");1334 if (state & CompAction::StateInitButton)
1335 {
1336 grabIndex = mScreen->pushPointerGrab (cursor, "resize");
1337 }
1338 else
1339 {
1340 grabIndex = mScreen->pushGrab (cursor, "resize");
1341 }
1335 }1342 }
13361343
1337 if (grabIndex)1344 if (grabIndex)
13381345
=== modified file 'plugins/resize/src/logic/tests/mock-screen.h'
--- plugins/resize/src/logic/tests/mock-screen.h 2012-08-16 14:04:59 +0000
+++ plugins/resize/src/logic/tests/mock-screen.h 2015-10-09 15:46:30 +0000
@@ -51,6 +51,8 @@
51 MOCK_METHOD2(otherGrabExist, bool(const char *, void *));51 MOCK_METHOD2(otherGrabExist, bool(const char *, void *));
52 MOCK_METHOD2(updateGrab, void(CompScreen::GrabHandle handle, Cursor cursor));52 MOCK_METHOD2(updateGrab, void(CompScreen::GrabHandle handle, Cursor cursor));
53 MOCK_METHOD2(pushGrab, CompScreen::GrabHandle(Cursor cursor, const char *name));53 MOCK_METHOD2(pushGrab, CompScreen::GrabHandle(Cursor cursor, const char *name));
54 MOCK_METHOD2(pushPointerGrab, CompScreen::GrabHandle(Cursor cursor, const char *name));
55 MOCK_METHOD1(pushKeyboardGrab, CompScreen::GrabHandle(const char *name));
54 MOCK_METHOD2(removeGrab, void(CompScreen::GrabHandle handle, CompPoint *restorePointer));56 MOCK_METHOD2(removeGrab, void(CompScreen::GrabHandle handle, CompPoint *restorePointer));
5557
56 MOCK_METHOD1(getOption, CompOption*(const CompString &name));58 MOCK_METHOD1(getOption, CompOption*(const CompString &name));
5759
=== modified file 'plugins/resize/src/screen-impl.h'
--- plugins/resize/src/screen-impl.h 2013-01-08 09:17:25 +0000
+++ plugins/resize/src/screen-impl.h 2015-10-09 15:46:30 +0000
@@ -102,6 +102,16 @@
102 return mImpl->pushGrab (cursor, name);102 return mImpl->pushGrab (cursor, name);
103 }103 }
104104
105 virtual CompScreen::GrabHandle pushPointerGrab (Cursor cursor, const char *name)
106 {
107 return mImpl->pushPointerGrab (cursor, name);
108 }
109
110 virtual CompScreen::GrabHandle pushKeyboardGrab (const char *name)
111 {
112 return mImpl->pushKeyboardGrab (name);
113 }
114
105 virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer)115 virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer)
106 {116 {
107 mImpl->removeGrab (handle, restorePointer);117 mImpl->removeGrab (handle, restorePointer);

Subscribers

People subscribed via source and target branches