Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set primary screen #26

Closed
guilhem opened this issue Mar 18, 2021 · 11 comments
Closed

Set primary screen #26

guilhem opened this issue Mar 18, 2021 · 11 comments

Comments

@guilhem
Copy link

guilhem commented Mar 18, 2021

(at least on Wayland) current behavior is to spawn terminal on current (mouse focus) screen.

Can it be able to set it on primary screen?

@amezin
Copy link
Member

amezin commented Mar 18, 2021

Unfortunately, no. GNOME's window manager tries to move all new windows to the current screen. When the extension tries to do something different, the result is crap. Though, honestly, I prefer the terminal window on the current screen, so I didn't invest too much time into this and gave up quickly

@TheMesoria
Copy link

That's a real pity. Hopefully you will keep an eye on it, as it is mildly annoying ;p

@amezin
Copy link
Member

amezin commented May 21, 2021

This feature will also require #45 if it will ever be implemented

@amezin
Copy link
Member

amezin commented May 26, 2021

Tried again today, still not working properly: the window initially appears on the "current" monitor, then moves to the specified one, and I can't do anything about that. This also breaks animations when current != specified. I definitely don't want to ship it in this state.

@amezin
Copy link
Member

amezin commented May 29, 2021

So it seems that the window initially flashes on current monitor because it's setting gtk-window-object-path (and other d-bus properties) too late (when the window is already visible). And I use that property to detect ddterm's window. The problem is - I can't find any other way to detect the window on Wayland

@amezin
Copy link
Member

amezin commented May 29, 2021

GNOME 40 + Wayland, other window properties:

May 30 04:06:55 trx40 gnome-shell[414730]: current_window.get_wm_class_instance()=com.github.amezin.ddterm
May 30 04:06:55 trx40 gnome-shell[414730]: current_window.get_startup_id()=null
May 30 04:06:55 trx40 gnome-shell[414730]: current_window.get_role()=null
May 30 04:06:55 trx40 gnome-shell[414730]: current_window.get_pid()=414730
May 30 04:06:55 trx40 gnome-shell[414730]: current_window.get_description()=W9
May 30 04:06:55 trx40 gnome-shell[414730]: current_window.window_type=0
May 30 04:06:55 trx40 gnome-shell[414730]: current_window.mutter_hints=null
May 30 04:06:55 trx40 gnome-shell[414730]: current_window.title=Drop Down Terminal
May 30 04:06:55 trx40 gnome-shell[414730]: current_window.wm_class=com.github.amezin.ddterm

GNOME 40 + XWayland:

May 30 04:07:59 trx40 gnome-shell[414730]: current_window.get_wm_class_instance()=com.github.amezin.ddterm
May 30 04:07:59 trx40 gnome-shell[414730]: current_window.get_startup_id()=null
May 30 04:07:59 trx40 gnome-shell[414730]: current_window.get_role()=null
May 30 04:07:59 trx40 gnome-shell[414730]: current_window.get_pid()=417041
May 30 04:07:59 trx40 gnome-shell[414730]: current_window.get_description()=0x800007
May 30 04:07:59 trx40 gnome-shell[414730]: current_window.window_type=0
May 30 04:07:59 trx40 gnome-shell[414730]: current_window.mutter_hints=null
May 30 04:07:59 trx40 gnome-shell[414730]: current_window.title=Drop Down Terminal
May 30 04:07:59 trx40 gnome-shell[414730]: current_window.wm_class=Com.github.amezin.ddterm

GNOME 40 + Xorg:

May 30 04:13:44 trx40 gnome-shell[421196]: current_window.get_wm_class_instance()=com.github.amezin.ddterm
May 30 04:13:44 trx40 gnome-shell[421196]: current_window.get_startup_id()=null
May 30 04:13:44 trx40 gnome-shell[421196]: current_window.get_role()=null
May 30 04:13:44 trx40 gnome-shell[421196]: current_window.get_pid()=421989
May 30 04:13:44 trx40 gnome-shell[421196]: current_window.get_description()=0x1e0000b
May 30 04:13:44 trx40 gnome-shell[421196]: current_window.window_type=0
May 30 04:13:44 trx40 gnome-shell[421196]: current_window.mutter_hints=null
May 30 04:13:44 trx40 gnome-shell[421196]: current_window.title=Drop Down Terminal
May 30 04:13:44 trx40 gnome-shell[421196]: current_window.wm_class=Com.github.amezin.ddterm

@amezin
Copy link
Member

amezin commented May 29, 2021

GNOME 3.36 + Xorg:

May 30 04:16:12 ubuntu-vm gnome-shell[1516]: current_window.get_wm_class_instance()=com.github.amezin.ddterm
May 30 04:16:12 ubuntu-vm gnome-shell[1516]: current_window.get_startup_id()=null
May 30 04:16:12 ubuntu-vm gnome-shell[1516]: current_window.get_role()=null
May 30 04:16:12 ubuntu-vm gnome-shell[1516]: current_window.get_pid()=1807
May 30 04:16:12 ubuntu-vm gnome-shell[1516]: current_window.get_description()=0x220000a
May 30 04:16:12 ubuntu-vm gnome-shell[1516]: current_window.window_type=0
May 30 04:16:12 ubuntu-vm gnome-shell[1516]: current_window.mutter_hints=null
May 30 04:16:12 ubuntu-vm gnome-shell[1516]: current_window.title=Drop Down Terminal
May 30 04:16:12 ubuntu-vm gnome-shell[1516]: current_window.wm_class=Com.github.amezin.ddterm

GNOME 3.36 + XWayland:

May 30 04:17:05 ubuntu-vm gnome-shell[2286]: current_window.get_wm_class_instance()=com.github.amezin.ddterm
May 30 04:17:05 ubuntu-vm gnome-shell[2286]: current_window.get_startup_id()=null
May 30 04:17:05 ubuntu-vm gnome-shell[2286]: current_window.get_role()=null
May 30 04:17:05 ubuntu-vm gnome-shell[2286]: current_window.get_pid()=2696
May 30 04:17:05 ubuntu-vm gnome-shell[2286]: current_window.get_description()=0xc00007
May 30 04:17:05 ubuntu-vm gnome-shell[2286]: current_window.window_type=0
May 30 04:17:05 ubuntu-vm gnome-shell[2286]: current_window.mutter_hints=null
May 30 04:17:05 ubuntu-vm gnome-shell[2286]: current_window.title=Drop Down Terminal
May 30 04:17:05 ubuntu-vm gnome-shell[2286]: current_window.wm_class=Com.github.amezin.ddterm

GNOME 3.36 + Wayland:

May 30 04:18:11 ubuntu-vm gnome-shell[2286]: current_window.get_wm_class_instance()=com.github.amezin.ddterm
May 30 04:18:11 ubuntu-vm gnome-shell[2286]: current_window.get_startup_id()=null
May 30 04:18:11 ubuntu-vm gnome-shell[2286]: current_window.get_role()=null
May 30 04:18:11 ubuntu-vm gnome-shell[2286]: current_window.get_pid()=-1
May 30 04:18:11 ubuntu-vm gnome-shell[2286]: current_window.get_description()=W14
May 30 04:18:11 ubuntu-vm gnome-shell[2286]: current_window.window_type=0
May 30 04:18:11 ubuntu-vm gnome-shell[2286]: current_window.mutter_hints=null
May 30 04:18:11 ubuntu-vm gnome-shell[2286]: current_window.title=Drop Down Terminal
May 30 04:18:11 ubuntu-vm gnome-shell[2286]: current_window.wm_class=com.github.amezin.ddterm

.get_pid() on 3.36 Wayland does not work :(

At least I can filter windows based on .get_wm_class_instance(). Though that won't filter out dialogs and popups created by ddterm. Well, maybe popups will be distinguishable by other properties... But dialogs on Wayland won't

@amezin
Copy link
Member

amezin commented May 29, 2021

Even wm_class and title are set too late

@amezin
Copy link
Member

amezin commented May 29, 2021

And trying to move all windows that belong to WaylandClient to the correct monitor from Meta.Display.window-created handler crashes GNOME Shell.

@amezin
Copy link
Member

amezin commented May 30, 2021

Though no, it can't be "too late", Window.shown arrives even later on Wayland.

amezin added a commit that referenced this issue Jun 30, 2021
@amezin
Copy link
Member

amezin commented Jun 30, 2021

Changed my mind about this. Even though I can't get it to work perfectly on Wayland native (window initially flickers on wrong monitor), it's usable. And on X11/XWayland everything works as it should.

Will be available in v19

@amezin amezin closed this as completed Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants