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

Get desktop workarea correctly on Linux (we cannot use _NET_WORKAREA) #3118

Open
dacap opened this issue Jan 6, 2022 · 0 comments · May be fixed by aseprite/laf#101
Open

Get desktop workarea correctly on Linux (we cannot use _NET_WORKAREA) #3118

dacap opened this issue Jan 6, 2022 · 0 comments · May be fixed by aseprite/laf#101

Comments

@dacap
Copy link
Member

dacap commented Jan 6, 2022

This should be a fix for this issue, the details are quoted here:

  • When we open the palette popup, it tries to use some space of the "workarea" (width/2, height*2/3)
  • That "workarea" is given by a fit_bounds() function
  • On Linux/X11, fit_bounds() gets the workarea from the _NET_WORKAREA property of the root window, which it looks like includes the workarea of all monitors/screens (because the property doesn't depend on a specific screen). I think here is the issue in our case, we should get the workarea of one specific screen in this case (as it does on Windows and macOS).

This issue was previously an item of #2777

Basically we want to get the area that will be used if we maximize the current window in its own screen. From https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm45682922243328 we can find:

With the introduction of the Xinerama extension in X11 R6.4, maximization has become more involved. Xinerama allows a screen to span multiple monitors in a freely configurable geometry. In such a setting, maximizing a window would ideally not grow it to fill the whole screen, but only the monitor it is shown on.

https://www.x.org/releases/X11R7.5/doc/man/man3/Xinerama.3.html

@dacap dacap added this to the v1.3-beta8 milestone Jan 6, 2022
@dacap dacap self-assigned this Jan 6, 2022
@dacap dacap changed the title Fix _NET_WORKAREA to get given screen workarea Get desktop workarea correctly on Linux (we cannot use _NET_WORKAREA) Jan 6, 2022
@dacap dacap modified the milestones: v1.3-beta8, v1.3-beta9 Jan 12, 2022
@dacap dacap modified the milestones: v1.3-beta12, v1.3-beta13 Mar 14, 2022
@dacap dacap modified the milestones: v1.3-beta15, v1.3.1 Jun 1, 2022
@dacap dacap removed their assignment Sep 15, 2022
@dacap dacap modified the milestones: v1.3.1, 1.3.2, v1.3.2, v1.3.3 Nov 28, 2023
@dacap dacap modified the milestones: v1.3.3, v1.3.4, v1.3.5 Feb 14, 2024
@dacap dacap modified the milestones: v1.3.5, v1.3.6 Feb 28, 2024
@dacap dacap modified the milestones: v1.3.6, v1.3.7 Apr 9, 2024
@dacap dacap modified the milestones: v1.3.7, v1.3.8 May 21, 2024
@ajerick ajerick linked a pull request Jul 21, 2024 that will close this issue
@dacap dacap modified the milestones: v1.3.8, v1.3.9 Aug 20, 2024
dacap pushed a commit to dacap/laf that referenced this issue Sep 12, 2024
Use Xrandr's XRRGetMonitors function to find find the position,
bounds, and "main screen" status of all monitors.

On X11, there is no supported method to find the workarea of a monitor.
This includes the _NET_WORKAREA atom, which breaks multi-monitor
setups. This may not be an issue as most window managers aggressively
and correctly enforce their, albeit private, workarea for windows.
@dacap dacap modified the milestones: v1.3.9, v1.3.10 Oct 1, 2024
@dacap dacap modified the milestones: v1.3.10, v1.3.11 Nov 20, 2024
@dacap dacap modified the milestones: v1.3.11, v1.3.12 Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant