xfdashboard icon indicating copy to clipboard operation
xfdashboard copied to clipboard

moving windows in a multi-head setup

Open remissio opened this issue 5 years ago • 4 comments

I love this feature. However, i'm not able to move maximized/fullscreen windows :(

It would be really helpfull to have this, as i have not yet found any way in xfce to move games to another Monitor (if they do not offer windowed mode themselves).

The cursor and dragging animation indicate it should work (it behaves the same as with non-maximized windows, it just doesn't move the window when dropped).

remissio avatar Mar 29 '19 09:03 remissio

I'm not a C-Developer but i've tried looking into this and i've managed to fix this issue for me.

The problem is wnck_window_set_geometry does not work on maximized/fullscreen windows.

To work around this issue i've chosen to temporarily remove those flags.

File: xfdashboard/libxfdashboard/x11/window-tracker-window-x11.c

Before:

	/* Set geometry */
	wnck_window_set_geometry(priv->window,
								WNCK_WINDOW_GRAVITY_STATIC,
								flags,
								inX, inY, inWidth, inHeight);

After:

	gboolean isFullscreen, isMaximized, isMaximizedHorizontally, isMaximizedVertically;
	isFullscreen = wnck_window_is_fullscreen(priv->window);
	isMaximized = wnck_window_is_maximized(priv->window);
	isMaximizedHorizontally = wnck_window_is_maximized_horizontally(priv->window);
	isMaximizedVertically = wnck_window_is_maximized_vertically(priv->window);
	if (isFullscreen)              wnck_window_set_fullscreen(priv->window, 0);
	if (isMaximized)               wnck_window_unmaximize(priv->window);
	if (isMaximizedHorizontally)   wnck_window_unmaximize_horizontally(priv->window);
	if (isMaximizedVertically)     wnck_window_unmaximize_vertically(priv->window);

	/* Set geometry */
	wnck_window_set_geometry(priv->window,
								WNCK_WINDOW_GRAVITY_STATIC,
								flags,
								inX, inY, inWidth, inHeight);

	if (isFullscreen)              wnck_window_set_fullscreen(priv->window, 1);
	if (isMaximized)               wnck_window_maximize(priv->window);
	if (isMaximizedHorizontally)   wnck_window_maximize_horizontally(priv->window);
	if (isMaximizedVertically)     wnck_window_maximize_vertically(priv->window);

Cheers! :)

remissio avatar Apr 14 '19 15:04 remissio

Hi,

First of all: Thanks for your issue and your work to resolve it. I thought I had already replied to this issue but - as we see - I did not. Sorry.

I also thought the window manager would do all the work as I tested exactly this situation on my workstation with two monitors. Do you use another windows manager as xfwm4?

Anyway your solution looks well I would like to include it. I hope I can do it soon.

Thanks Stephan

gmc-holle avatar May 02 '19 11:05 gmc-holle

I did indeed test this within xfwm4 from the Archlinux repositories. Installed was xfdashboard through the AUR Package.

I'm glad i could help :) Daniel

remissio avatar May 02 '19 13:05 remissio

Sadly I missed to include it in the new development version. Keeping this issue to not forget it at next release ... I'm really sorry :'(

gmc-holle avatar Nov 29 '19 12:11 gmc-holle