After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670658 - display: Add signals for plugins to know when a grab op begins/ends
display: Add signals for plugins to know when a grab op begins/ends
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-02-23 06:16 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-03-13 04:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
display: Add signals for plugins to know when a grab op begins/ends (2.42 KB, patch)
2012-02-23 06:16 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
display: Add signals for plugins to know when a grab op begins/ends (2.42 KB, patch)
2012-02-23 21:41 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
display: Add signals for plugins to know when a grab op begins/ends (2.58 KB, patch)
2012-03-11 08:04 UTC, Jasper St. Pierre (not reading bugmail)
rejected Details | Review
display: Add signals for plugins to know when a grab op begins/ends (2.58 KB, patch)
2012-03-12 19:53 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-02-23 06:16:14 UTC
This is required to have an extension like Wobbly Windows or something like
it that needs to know when the user starts shoving a window around.

This is the simplest patch I made, and it would probably conflict with
Carlos's work on multitouch. Should the signals be on MetaWindow instead?
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-02-23 06:16:17 UTC
Created attachment 208228 [details] [review]
display: Add signals for plugins to know when a grab op begins/ends
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-02-23 21:41:01 UTC
Created attachment 208309 [details] [review]
display: Add signals for plugins to know when a grab op begins/ends

s/MUTTER_/META_/ for enum types.
Comment 3 Owen Taylor 2012-03-09 22:11:10 UTC
Review of attachment 208309 [details] [review]:

It's a little hard for me to tell if everything is passed in to these signals that is useful - do we need the timestamp? the button? etc? The only proof will be in how people use them - we might as well start out simple like this.

I think the one thing that I will suggest adding is the MetaScreen - it's possible to begin a no-window grab op, and in that case, there is no indication here of what screen things are happening on, but that's important in terms of how the APIs are designed currently ... while multiple screens don't actually work, the APIs still expect MetaScreen in many places.

IMO, the two signals should either be emitted:

 Before anything is established and after everything is released

Or:

 After everything is established and before anything is released

But while begin-grab-op is emitted after thing is established, end-grab-op is emitted in the middle of things - I'd move to before anything happens.

::: src/core/display.c
@@ +139,3 @@
   WINDOW_MARKED_URGENT,
+  BEGIN_GRAB_OP,
+  END_GRAB_OP,

I would prefer:

 grab-op-begin
 grab-op-end

to make it clear these are notifications and not places where you can hook in to implement things a different way.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-03-11 08:04:23 UTC
Created attachment 209420 [details] [review]
display: Add signals for plugins to know when a grab op begins/ends

Yeah, I chose not to add too much besides what we needed. If we need more
eventually, we can add those.
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-03-11 20:22:51 UTC
Review of attachment 209420 [details] [review]:

No, this won't work, since the grab window may be NULL. I'm not sure how to get the actual screen here.
Comment 6 Owen Taylor 2012-03-12 15:38:13 UTC
There's display->grab_screen
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-03-12 19:53:54 UTC
Created attachment 209536 [details] [review]
display: Add signals for plugins to know when a grab op begins/ends

Oi, I'm not sure how I missed that. Thanks!
Comment 8 Owen Taylor 2012-03-13 00:27:21 UTC
Review of attachment 209536 [details] [review]:

it's sort of weird that begin_grab_op() is screen/window/op while this is screen/op/window - can you swap that around before committing?
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-03-13 02:51:21 UTC
Review of attachment 209536 [details] [review]:

"can you swap that around before committing?"

Did you mean to mark this ACN then?
Comment 10 Owen Taylor 2012-03-13 03:05:30 UTC
(In reply to comment #9)
> Review of attachment 209536 [details] [review]:
> 
> "can you swap that around before committing?"
> 
> Did you mean to mark this ACN then?

I meant that you could commit with that fix, yes.
Comment 11 Jasper St. Pierre (not reading bugmail) 2012-03-13 04:43:25 UTC
Attachment 209536 [details] pushed as efc9017 - display: Add signals for plugins to know when a grab op begins/ends


Pushed with suggested changes. Thanks for reviewing, now we can have gravity/wobbly for 3.2 (maybe)