Recent

Author Topic: Linux Workspaces -- StayOnTop?  (Read 2056 times)

QEnnay

  • Full Member
  • ***
  • Posts: 125
Linux Workspaces -- StayOnTop?
« on: April 17, 2024, 06:48:51 pm »
Hi, I need an app to stay visible on all workspaces.

I have tried setting the Form with fsStayOnTop and fsSystemStayOnTop but it is not visible when I switch to another Workspace.

I know it is possible as the Linux App, "sticky" (yellow notes) does it. I just cannot figure out how to make it work with my code.

How do I do this?

Thanks
Linux-Mint 20.1 x64 + Cinnamon; Lenovo Flex 5 Ryzen 5 4500, 16GB memory
FPC: 3.2.0-1, Lazarus 2.0.12-0, all 64bit

VisualLab

  • Hero Member
  • *****
  • Posts: 569
Re: Linux Workspaces -- StayOnTop?
« Reply #1 on: April 17, 2024, 11:25:09 pm »
Hi, I need an app to stay visible on all workspaces.

I have tried setting the Form with fsStayOnTop and fsSystemStayOnTop but it is not visible when I switch to another Workspace.

I know it is possible as the Linux App, "sticky" (yellow notes) does it. I just cannot figure out how to make it work with my code.

How do I do this?

Thanks

And it works in any windowed environment? Or maybe only in GNOME and KDE? I'm asking because Linux doesn't have a standard DE. Each of them works "in its own way".

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Linux Workspaces -- StayOnTop?
« Reply #2 on: April 18, 2024, 02:13:13 am »
In my App, I use a system tray icon that the user can use to "call" any open windows to what ever workspace is currently open.

I mention this because with the recent adoption of Wayland many of the X11 things we take fro granted are disappearing so, if you do find a solution that does what you want, make sure it works under wayland before you build it into your app.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

MarkMLl

  • Hero Member
  • *****
  • Posts: 8007
Re: Linux Workspaces -- StayOnTop?
« Reply #3 on: April 18, 2024, 08:12:09 am »
And it works in any windowed environment? Or maybe only in GNOME and KDE? I'm asking because Linux doesn't have a standard DE. Each of them works "in its own way".

I think it would be worth replacing "Linux" with "unix" there, and the situation with a Window Manager which might- or might not- be distinct from the overall desktop environment is highly variable.

In fact I believe that the whole idea of having multiple desktops is basically an MS Windows one, where originally they were implemented using the Windowstations layer which was added mainly to support Windows NT Terminal Server but then repurposed.

While unix introduced that sort of functionality with e.g. the fvwm Window Manager, X11 doesn't have an equivalent layer and so I believe has to emulate it by minimising/hiding and restoring each window. That makes "keep on top" etc. highly sensitive to hidden implementation details.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

AmatCoder

  • Jr. Member
  • **
  • Posts: 59
    • My site
Re: Linux Workspaces -- StayOnTop?
« Reply #4 on: April 18, 2024, 08:21:27 am »
Quote
Hi, I need an app to stay visible on all workspaces.

Wayland  ->  You (as developer) can't force that.
X11  ->  You can force it but ultimately it depends on Window Manager (normally it works).

Quote
I know it is possible as the Linux App, "sticky" (yellow notes) does it.

GTK has a function for that (only works on X11): https://developer-old.gnome.org/gtk2/stable/GtkWindow.html#gtk-window-stick

As far as I remember, Qt has nothing similar.

QEnnay

  • Full Member
  • ***
  • Posts: 125
Re: Linux Workspaces -- StayOnTop?
« Reply #5 on: April 18, 2024, 02:40:24 pm »
Thanks, but as I mentioned "sticky" is making it work. I just tested "sticky" on another laptop that is using Wayland (dev version) and it works on both.

Clearly it is doable, just not with FPC/Laz  then?
Linux-Mint 20.1 x64 + Cinnamon; Lenovo Flex 5 Ryzen 5 4500, 16GB memory
FPC: 3.2.0-1, Lazarus 2.0.12-0, all 64bit

AmatCoder

  • Jr. Member
  • **
  • Posts: 59
    • My site
Re: Linux Workspaces -- StayOnTop?
« Reply #6 on: April 18, 2024, 08:34:20 pm »
Are you tried on a pure Wayland session? Without XWayland?
(XWayland is a X11 emulation layer under Wayland.)

Let's see:
Sticky is a Python/Gtk3 app. It uses gtk_window_stick() function.

gtk_window_stick() goes to gdk_x11_window_stick on X11 and to gdk_wayland_window_stick on Wayland.

As you can see gdk_wayland_window_stick function is empty so it does nothing.

 

TinyPortal © 2005-2018