xfce4-windowck-plugin icon indicating copy to clipboard operation
xfce4-windowck-plugin copied to clipboard

[Feature Request] Moving Windows

Open fthpi opened this issue 10 years ago • 11 comments

Hi, can you add move windows drag window with title feature? Like cinnamon Window Buttons with Title applet. (http://cinnamon-spices.linuxmint.com/applets/view/184). If you add this option, maybe i use xfce for default DE :) thanks

fthpi avatar May 27 '14 01:05 fthpi

To move windows left click on icon window button and select move in the menu. You can double click on the title to unmaximize the window.

What you want is move windows by dragging the title? I'll see how to implement it Cheers,

Cédric

takinoy avatar May 27 '14 17:05 takinoy

Thanks Cédric. Moving windows is more than easy double click for snap window. I am developer cinnamon Window Buttons with Title applet. I use below code (but this code use gnome-shell classes most probably not aid for you) for move window;

//Set cursor position on windows title let pointer = Gdk.Display.get_default().get_device_manager().get_client_pointer(), [scr,,] = pointer.get_position(), rect = current_window.get_outer_rect(), x = rect.x + rect.width / 2, y = rect.y; pointer.warp(scr, x, y); // End of set cursor //Move windows
global.display.begin_grab_op(global.screen, current_window,Meta.GrabOp.MOVING, false, true, 0, 0, global.get_current_time(), x, y);

fthpi avatar May 29 '14 12:05 fthpi

Hello,

Thanks for your answer. My applet is written in C not in Java but that could help a bit. My first problem is to find a proper way to grab windows in C. I use the wnck library for managing window and there is not convenient function to grab window directly....

I try to do my best but I'm quite new in developing panel applet, so your help is welcome!

takinoy avatar May 29 '14 16:05 takinoy

Hi, I am newbie apple developer too, i can suggest temporary solution. You can control keyboard with xdotool, you can use below command for grabbinng window; xdotool keydown key alt+F7 I don't know C well but i estimate a solution. Firstly, get pointer position (x,y) (there are sample codes written in C) after you can set windows geometry (same pointer position until release button) with wnck_window_set_geometry () function (https://developer.gnome.org/libwnck/stable/WnckWindow.html). This is only estimation, as i said, i am newbie.

fthpi avatar May 30 '14 08:05 fthpi

Hello, To grab window with keyboard method in C we could use wnck_window_keyboard_move (WnckWindow *window); that do the same thing as the move command in the icon title menu or xdotool keydown key alt+F7. I've tested it in may code and that work well, despite the fact that we need to click with a button on the title (double click in my case), not drag on it... It's not very intuitive. Also, the problem is I already use double click to unmaximize window and it's the default behaviour for xfwm4...

For implementing grab window with mouse method, I've also considering using wnck_window_set_geometry function but I do not managed to get it working for now...

In fact, even if I managed to get it working, I will not be very happy with that solution because it can't reproduce the native behaviour of xfwm4 window dragging. Especially edge tilling.

(That doesn't solve this issue but you can also press Alt+click on window to easily move it)

takinoy avatar May 30 '14 12:05 takinoy

Hi, I see, you are right. I found a solution. I am using compiz as window decorator. In compiz config settings, i defined command (top+click button1) for "xdotool keydown key alt+F7" command. Now, it is better. Thanks your concern.

fthpi avatar Jun 05 '14 01:06 fthpi

Ok. I can consider adding such feature with mouse action (Alt+click_button1 or triple click)...

takinoy avatar Jun 05 '14 08:06 takinoy

I see that this is a fairly old request, however - I too am looking for something like this.

waldnercharles avatar Jan 24 '15 17:01 waldnercharles

:+1: me too!

n1trux avatar Jun 14 '15 09:06 n1trux

I prototyped this feature in my fork. It triggers on button press instead of drag though.

EDIT: wnck_window_keyboard_move does the same as my code, except it sends _NET_WM_MOVERESIZE_MOVE_KEYBOARD instead of _NET_WM_MOVERESIZE_MOVE. I wonder if that should be reported as feature request on libwnck.

rrika avatar Nov 12 '15 21:11 rrika

any new process recent?

godcrying avatar Jun 25 '19 06:06 godcrying