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
1=== modified file 'plugins/resize/src/logic/include/screen-interface.h'
2--- plugins/resize/src/logic/include/screen-interface.h 2013-01-08 09:17:25 +0000
3+++ plugins/resize/src/logic/include/screen-interface.h 2015-10-09 15:46:30 +0000
4@@ -56,6 +56,8 @@
5 virtual bool otherGrabExist (const char *, void *) = 0;
6 virtual void updateGrab (CompScreen::GrabHandle handle, Cursor cursor) = 0;
7 virtual CompScreen::GrabHandle pushGrab (Cursor cursor, const char *name) = 0;
8+ virtual CompScreen::GrabHandle pushPointerGrab (Cursor cursor, const char *name) = 0;
9+ virtual CompScreen::GrabHandle pushKeyboardGrab (const char *name) = 0;
10 virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer) = 0;
11
12 /* CompOption::Class */
13
14=== modified file 'plugins/resize/src/logic/src/resize-logic.cpp'
15--- plugins/resize/src/logic/src/resize-logic.cpp 2015-03-19 15:14:55 +0000
16+++ plugins/resize/src/logic/src/resize-logic.cpp 2015-10-09 15:46:30 +0000
17@@ -139,7 +139,7 @@
18 case ClientMessage:
19 if (event->xclient.message_type == Atoms::wmMoveResize)
20 {
21- unsigned long type = event->xclient.data.l[2];
22+ unsigned long type = event->xclient.data.l[2];
23
24 if (type <= WmMoveResizeSizeLeft ||
25 type == WmMoveResizeSizeKeyboard)
26@@ -161,7 +161,7 @@
27 CompOption::TypeBool));
28 o[1].value ().set (true);
29
30- if (event->xclient.data.l[2] == WmMoveResizeSizeKeyboard)
31+ if (type == WmMoveResizeSizeKeyboard)
32 {
33 initiateResizeDefaultMode (&options->optionGetInitiateKey (),
34 CompAction::StateInitKey,
35@@ -1331,7 +1331,14 @@
36 else
37 cursor = cursorFromResizeMask (mask);
38
39- grabIndex = mScreen->pushGrab (cursor, "resize");
40+ if (state & CompAction::StateInitButton)
41+ {
42+ grabIndex = mScreen->pushPointerGrab (cursor, "resize");
43+ }
44+ else
45+ {
46+ grabIndex = mScreen->pushGrab (cursor, "resize");
47+ }
48 }
49
50 if (grabIndex)
51
52=== modified file 'plugins/resize/src/logic/tests/mock-screen.h'
53--- plugins/resize/src/logic/tests/mock-screen.h 2012-08-16 14:04:59 +0000
54+++ plugins/resize/src/logic/tests/mock-screen.h 2015-10-09 15:46:30 +0000
55@@ -51,6 +51,8 @@
56 MOCK_METHOD2(otherGrabExist, bool(const char *, void *));
57 MOCK_METHOD2(updateGrab, void(CompScreen::GrabHandle handle, Cursor cursor));
58 MOCK_METHOD2(pushGrab, CompScreen::GrabHandle(Cursor cursor, const char *name));
59+ MOCK_METHOD2(pushPointerGrab, CompScreen::GrabHandle(Cursor cursor, const char *name));
60+ MOCK_METHOD1(pushKeyboardGrab, CompScreen::GrabHandle(const char *name));
61 MOCK_METHOD2(removeGrab, void(CompScreen::GrabHandle handle, CompPoint *restorePointer));
62
63 MOCK_METHOD1(getOption, CompOption*(const CompString &name));
64
65=== modified file 'plugins/resize/src/screen-impl.h'
66--- plugins/resize/src/screen-impl.h 2013-01-08 09:17:25 +0000
67+++ plugins/resize/src/screen-impl.h 2015-10-09 15:46:30 +0000
68@@ -102,6 +102,16 @@
69 return mImpl->pushGrab (cursor, name);
70 }
71
72+ virtual CompScreen::GrabHandle pushPointerGrab (Cursor cursor, const char *name)
73+ {
74+ return mImpl->pushPointerGrab (cursor, name);
75+ }
76+
77+ virtual CompScreen::GrabHandle pushKeyboardGrab (const char *name)
78+ {
79+ return mImpl->pushKeyboardGrab (name);
80+ }
81+
82 virtual void removeGrab (CompScreen::GrabHandle handle, CompPoint *restorePointer)
83 {
84 mImpl->removeGrab (handle, restorePointer);

Subscribers

People subscribed via source and target branches