[Gambas-user] gb.desktop.x11 LargeDesktop support
benoit.minisini at gambas-basic.org
Tue Oct 25 23:44:18 CEST 2022
Le 25/10/2022 à 23:38, Bruce Steers a écrit :
> So my recent discovery was this...
> using gb.desktop.x11 there are Desktop/Workspace switching features.
> I found this info... @
> Large Desktops
> The window manager may offer to arrange the managed windows on a desktop
> that is larger than the root window. The screen functions as a viewport
> on this large desktop. Different policies regarding the positioning of
> the viewport on the desktop can be implemented: The window manager may
> only allow the viewport position to change in increments of the screen
> size (paging) or it may allow arbitrary positions (scrolling).
> To fulfill the ICCCM principle that clients should behave the same
> regardless whether a window manager is running or not, window managers
> which implement large desktops must interpret all client-provided
> geometries with respect to the current viewport.
> Implementation note
> There are two options for implementing a large desktop: The first is to
> keep the managed windows (or, if reparenting, their frames) as children
> of the root window. Moving the viewport is achieved by moving all
> managed windows in the opposite direction.
> The second alternative is to reparent all managed windows to a dedicated
> large window (somewhat inappropriately called a 'virtual root'). Moving
> the viewport is then achieved by moving the virtual root in the opposite
> Both alternatives are completely ICCCM compliant, although the second
> one may be somewhat problematic for clients trying to figure out the
> window manager decorations around their toplevel windows and for clients
> trying to draw background images on the root window.
> So from that we see there are 2 ways of implementing the desktops, one
> involves multiple viewports and one is one large screen.
> It seems gb.desktop.x11 is coded to handle the multiple desktops method
> but not the single big screen type :(
> I'm almost there with implementing this (see attached project)
> the project contains a folder called X11LargeDesktop containing files
> that add the following to gb.desktop.x11
> X11.DesktopCount and X11.CurrentDesktop now works for large desktops.
> DesktopWindow.Desktop now also works for large desktops.
> X11.IsLargeDesktop True if large desktop false if multiple viewports.
> X11.ViewPorts returns a list of the viewport positions if using large
> desktop taking Orientation into account. Still todo: handle start
> corners, currently assumes TopLeft.
> X11.Supported As String, returns a list of the supported wm commands
> (from hint _NET_SUPPORTED)
> X11.GetDesktopNames(DefaultName as String="Workspace") , get's the
> desktop names or makes them up if not found.
> From what i have read the hint _NET_DESKTOP_LAYOUT is the key, a single
> large desktop will have this set but multiple desktops will not so i
> have used that as the check criteria. I also seems my MATE is the only
> desktop that uses the large screen method.
> Also i'm handling using multiple rows/columns as defined at
> <https://specifications.freedesktop.org/wm-spec/1.3/ar01s03.html> but I
> cannot test it as my desktop does not do it.
> (have not handled start corners yet)
> tested on LinuxMint, desktops MATE/Plasma/Cinnamon/Gnome
> other than my Mint/MATE the class uses the original X11 routines that we
> know works for multiple viewport desktops.
> Dunno if you want to rip this code Ben (or laugh at my awful
> implementation and do it properly yourself ;) lol ) gb.desktop.x11 is
> lacking this "other method" so here's a little work on the matter :)
> Wishing well
I will look at it.
More information about the User