GNOME Bugzilla – Bug 670658
display: Add signals for plugins to know when a grab op begins/ends
Last modified: 2012-03-13 04:43:27 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?
Created attachment 208228 [details] [review] display: Add signals for plugins to know when a grab op begins/ends
Created attachment 208309 [details] [review] display: Add signals for plugins to know when a grab op begins/ends s/MUTTER_/META_/ for enum types.
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.
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.
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.
There's display->grab_screen
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!
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?
Review of attachment 209536 [details] [review]: "can you swap that around before committing?" Did you mean to mark this ACN then?
(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.
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)