On Fri, Jun 15, 2012 at 1:41 AM, Amy C <mathematical.cof...@gmail.com> wrote: > Hi all, > > I'm trying to implement the functionality of 'Move' in the right-click > menu of a window (you right click the system title bar, select 'move', > and then moving your cursor about moves the target window about until > you click, on which it then has its position set). Note that this is > not a drag operation as the cursor does not need to be held down while > you're moving the window around. > > I was suggested to use global.display.begin_grab_op on the window, so > this is what I'm doing: > > global.display.begin_grab_op(global.screen, window, Meta.GrabOp.MOVING, > false /* whether > cursor's already grabbed */, > true /* frame action */, > 1 /* primary mouse button */, > 0 /* event flags */, > global.get_current_time(), > x, /* x coord of the window */ > y); /* y coord of the window */ > > However, this always fails with: > > Window manager warning: Attempt to perform window operation 1 on > window 0x2006f32 when operation 38 on none already in effect. > > A bit of digging around revelas that operation 38 is > Meta.GrabOp.COMPOSITOR, which "is returned if a compositor-plugin > modal operation is in effect". > > My grab op won't happen until this one finishes, but it looks like > this is always in effect (thanks to calls to meta_plugin_begin_modal > on the global stage).
Ah, sorry, I didn't think of that. The grab is due to the app menu. You might be able to use a Meta.run_later; I'm not entirely sure. > If I try to finish the grab op 38 > (global.display.end_grab_op(global.get_current_time()) and then > perform my command, it works, but on finishing moving my window around > I can't get focus back to the global stage - clicking & keyboard don't > work. I have to switch to tty to gnome-shell --replace to get > funcitonality back. > > So how do I do my grab op without interfering with gnome-shell? Should > I try ending the grab op as before, but set a signal for when I'm > finished moving the window to call global.begin_modal (??) to restore > the grab op 38 that gnome-shell has? > > cheers. > _______________________________________________ > gnome-shell-list mailing list > gnome-shell-list@gnome.org > https://mail.gnome.org/mailman/listinfo/gnome-shell-list -- Jasper _______________________________________________ gnome-shell-list mailing list gnome-shell-list@gnome.org https://mail.gnome.org/mailman/listinfo/gnome-shell-list