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

Able to choose which monitor to display on #64

Closed
wants to merge 2 commits into from
Closed

Conversation

ErikReider
Copy link
Owner

  • Choose monitor as config option
  • Notification window logic
  • Control center logic
  • Test if disconnecting monitor breaks this
  • Open on focused monitor if the chosen display isn't found

@ErikReider ErikReider added the enhancement New feature or request label Jan 24, 2022
@ErikReider ErikReider self-assigned this Jan 24, 2022
@ErikReider ErikReider linked an issue Jan 24, 2022 that may be closed by this pull request
@nwg-piotr
Copy link

nwg-piotr commented Jan 25, 2022

You may have a better idea. My solution only supports symbolic output names (like eDP-1). I list them by the sway IPC, then list Gdk.Monitor instances. By comparing x and y coordinates, I map output names to Gdk.Monitors. Then I only need layershell.SetMonitor. See this.

@ErikReider
Copy link
Owner Author

You may have a better idea. My solution only supports symbolic output names (like eDP-1). I list them by the sway IPC, then list Gdk.Monitor instances. By comparing x and y coordinates, I map output names to Gdk.Monitors. Then I only need layershell.SetMonitor. See this.

I'll take a look at this after work :)

@ErikReider
Copy link
Owner Author

But it doesn't work on other wlroots based WMs though right? The most optimal solution would be to not use sway ipc. Does your stuff work in dwl and river?

@nwg-piotr
Copy link

To list outputs on other compositors, you'd need to talk to wlroots, or just parse wlr-randr output.

@nightly-brew
Copy link
Contributor

Although it's easier said than done, It would be better to avoid binding to another specific program like wlr-randr, and instead make use of wayland protocols directly I think.

@nwg-piotr
Copy link

Of course. I didn't care about it much, as the shell is primarily aimed at sway. Finally I won't avoid doing the same.

@nwg-piotr
Copy link

nwg-piotr commented Jan 26, 2022

While working on the Swaync panel module, I realized, that the output selection is not really essential to me, since the client will be opened on icon click. In most cases (apart from gtk-layer-shell oddities) the appropriate output will be already focused. The only use of this feature would be to determine which screen to display notifications themselves on.

@nightly-brew
Copy link
Contributor

While working on the Swaync panel module, I realized, that the output selection is not really essential to me, since the client will be opened on icon click. In most cases (apart from gtk-layer-shell oddities) the appropriate output will be already focused. The only use of this feature would be to determine which screen to display notifications themselves on.

Makes sense to me!

Reading around I think the compositor should provide a wl_output for each output without any need to register an output manager, though at least registering a listener for output events might be useful to change output if the configured one is disconnected/unregistered, for instance.

@ErikReider
Copy link
Owner Author

While working on the Swaync panel module, I realized, that the output selection is not really essential to me, since the client will be opened on icon click. In most cases (apart from gtk-layer-shell oddities) the appropriate output will be already focused. The only use of this feature would be to determine which screen to display notifications themselves on.

Makes sense to me!

Reading around I think the compositor should provide a wl_output for each output without any need to register an output manager, though at least registering a listener for output events might be useful to change output if the configured one is disconnected/unregistered, for instance.

Yeah. I'll need to build some vala bindnings

@nwg-piotr
Copy link

No hurry, if it comes to integration with the shell. It's absolutely usable as is, and looks great.

@ErikReider ErikReider marked this pull request as draft February 15, 2022 16:54
@ErikReider
Copy link
Owner Author

@nwg-piotr Found out that there's a way of getting display connector names in GDK but it was deprecated. In GDK 4 they have gdk_monitor_get_connector which also exists in GDK 3 but is private. https://gitlab.gnome.org/GNOME/gtk/-/issues/4982

@nwg-piotr
Copy link

For my use case I just attached swaync-client -t to a panel icon, so the window opens where I want it to. No major problem.

image

@MathisP75
Copy link

Has this feature been abandoned?

@ErikReider ErikReider closed this May 14, 2023
@ErikReider ErikReider deleted the choose-output branch May 14, 2023 14:02
@ErikReider
Copy link
Owner Author

Has this feature been abandoned?

I've moved it into #262

The only issue is a segfault on monitor disconnect. Otherwise it's ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] Bind the client window to the output
4 participants