Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-10

Linux Window Manager Enhancements

8 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anthony Walter

Does anyone have experience or interest in enhancing window management support for Linux with Lazarus?

I was reading up on the window management systems for Linux like Compiz, KWin, Xcfe and found they and many other support a common protocol for doing things like:

* altering window z-order
* making window sticky or above
* switching windows between desktop
* listing desktops
* adding or removing desktops
* switching between desktop
* listing windows
* resizing windows
* activating and deactiving windows for user input

... and more

The program wmctrl is an example of such how functionality can be administered programatically.

I think it would be very useful if some of these functionality could be brought into Lazarus, especially in areas with Lazarus which don't work as desired (Application.BringToFront) on some Linux systems.

A specification for administering these tasks on X windows is NetWM. Here is some reference material if anyone cares to ://standards.freedesktop.org/wm-spec/wm-spec-latest.html http://en.wikipedia.org/wiki/Extended_Window_Manager_Hints http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/netwm_8h.html

Maybe we can add this type of functionality to a Lazarus package and perhaps use it to plug a few holes with LCL on Linux.

or

Maybe we can use this type of functionality to increase our programatic access to window management on Linux.

A penny for your thoughts.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151028/6ce6fcb9/attachment-0001.html>

Reply by email

Den
to Anthony Walter

It's called "XLib", but since Wayland, and Canonical's Mir are coming out, XServer will (eventually) be left in the dust as outdated (I'm sure they'll have compatibility for awhile). Or someone could be a dear, and write a libEGL version with custom components, and use hardware acceleration for the entire interface, and shaders for some nice effects like shadows, etc. The whole thing being smoothly animated, and .. Oh yeah, so back to the topic: Until then as long as you're using an XLib (X Protocol) based desktop, then using those functions should be easy. Just grab a display handle, and a window handle from GTK, and use the functions!

- Dennis Fehr

P.S. Where's my penny? (joking haha) ;)

Anthony Walter wrote 49 lines
Does anyone have experience or interest in enhancing window management support for Linux with Lazarus? I was reading up on the window management systems for Linux like Compiz, KWin, Xcfe and found they and many other support a common protocol for doing things like: * altering window z-order * making window sticky or above * switching windows between desktop * listing desktops * adding or removing desktops * switching between desktop * listing windows * resizing windows * activating and deactiving windows for user input ... and more The program wmctrl is an example of such how functionality can be administered programatically. I think it would be very useful if some of these functionality could be brought into Lazarus, especially in areas with Lazarus which don't work as desired (Application.BringToFront) on some Linux systems. A specification for administering these tasks on X windows is NetWM. Here is some reference material if anyone cares to look at it. http://standards.freedesktop.org/wm-spec/wm-spec-latest.html http://en.wikipedia.org/wiki/Extended_Window_Manager_Hints http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/netwm_8h.html Maybe we can add this type of functionality to a Lazarus package and perhaps use it to plug a few holes with LCL on Linux. or Maybe we can use this type of functionality to increase our programatic access to window management on Linux. A penny for your thoughts. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151028/fd09c173/attachment.html>

Reply by email

Anthony Walter
to Den

Actually XLib does provide control over layering windows, input focus, z-order, virtual desktops. It's the window manager (KWin, Compiz, Metacity, IceWM, and so on) which handles this.

As such, with some tookits and window manager combinations it's not possible to do certain things without special code to work around specific combinations of both. For example, when writing a Gtk2 application with Compiz it's not possible to alter the z-order of your application, ie bringing it to the foreground and/or activating it. XLib won't help you with this.

But the good news is that most all window managers expose window management functionality through a common protocol: NetWM

For example the _NET_WM_STATE message can be used to reorder the stack of application windows above or below one another (bringing your application to the top). It can be used to make your window sticky (to appear in the same place in all workspaces).

The _NET_ACTIVE_WINDOW can be used to find application window with input focus. It can also be used to give input focus to another application window.

These are all thing which XLib doesn't cover, and areas where Lazarus and some toolkits/window managers struggle with parity. That is, without a common protocol like NetWM.

Anyhow, if anyone is still interested, I've written a Free Pascal unit to interface with the NetWM protocol. So far I've tested it with Gtk2 on Compix with the following functionality:

Show/hide desktop [x] works
Switch workspace [x] works
Sticky/unsticky a window [x] works
Move window to a different workspace [x] works
Cycle various application z-orders [x] works

I will implement a few more functions and then post the unit to github. I'd like to get application activation, bypassing window animations, and a few other features working. When posted if people with different window managers (KDE's KWin) want to test it, that would be great. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151028/517b481c/attachment.html>

Reply by email

Anthony Walter
to Den: It's called "XLib", but since Wayland, and Canonical's Mir are coming out, XServer will…

Actually XLib does NOT provide control over layering windows, input focus, z-order, virtual desktops. It's the window manager (KWin, Compiz, Metacity, IceWM, and so on) which handles this.

As such, with some tookits and window manager combinations it's not possible to do certain things without special code to work around specific combinations of both. For example, when writing a Gtk2 application with Compiz it's not possible to alter the z-order of your application, ie bringing it to the foreground and/or activating it. XLib won't help you with this.

But the good news is that most all window managers expose window management functionality through a common protocol: NetWM

For example the _NET_WM_STATE message can be used to reorder the stack of application windows above or below one another (bringing your application to the top). It can be used to make your window sticky (to appear in the same place in all workspaces).

The _NET_ACTIVE_WINDOW can be used to find application window with input focus. It can also be used to give input focus to another application window.

These are all thing which XLib doesn't cover, and areas where Lazarus and some toolkits/window managers struggle with parity. That is, without a common protocol like NetWM.

Anyhow, if anyone is still interested, I've written a Free Pascal unit to interface with the NetWM protocol. So far I've tested it with Gtk2 on Compix with the following functionality:

Show/hide desktop [x] works
Switch workspace [x] works
Sticky/unsticky a window [x] works
Move window to a different workspace [x] works
Cycle various application z-orders [x] works

I will implement a few more functions and then post the unit to github. I'd like to get application activation, bypassing window animations, and a few other features working. When posted if people with different window managers (KDE's KWin) want to test it, that would be great. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151028/7f3854e0/attachment-0001.html>

Reply by email

Anthony Walter
to Anthony Walter

https://github.com/sysrpl/Lazarus.NetWM

This is the a repository for a Lazarus unit to make some window management functions on X easier.

The following functionality is currently supported:

* Activating your applciation, bringing it to the foreground with input focus
* Sticking windows to multiple workspaces
* Calling attention to your application (varies by window manager)
* Going into and out of fullscreen mode
* Shading your window
* Making your window topmost

Functionality left out:

* Defining and switching workspaces
* Querying desktops areas and redefining desktop positions and sizes
* Window and desktop enumerating
* Closing, moving, resizing windows other than your own
* Hiding windows from the taskbar and application switcher
* Turning window animations on and off
* Switching window types

For more informationSee the NetWM protocol see:

http://standards.freedesktop.org/wm-spec/1.3/index.html -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151029/2bd101fc/attachment.html>

Reply by email

Den
to Anthony Walter

I prefer just using XLib to send the _NET_WM_* commands.. Like maximize, etc. I've done it before, my Game Engine I wrote using X uses it, and works with moving, hiding, etc.

- Dennis

Anthony Walter wrote 35 lines
https://github.com/sysrpl/Lazarus.NetWM This is the a repository for a Lazarus unit to make some window management functions on X easier. The following functionality is currently supported: * Activating your applciation, bringing it to the foreground with input focus * Sticking windows to multiple workspaces * Calling attention to your application (varies by window manager) * Going into and out of fullscreen mode * Shading your window * Making your window topmost Functionality left out: * Defining and switching workspaces * Querying desktops areas and redefining desktop positions and sizes * Window and desktop enumerating * Closing, moving, resizing windows other than your own * Hiding windows from the taskbar and application switcher * Turning window animations on and off * Switching window types For more informationSee the NetWM protocol see: http://standards.freedesktop.org/wm-spec/1.3/index.html -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151029/4525cf37/attachment.html>

Reply by email

Den
to Anthony Walter: Actually XLib does NOT provide control over layering windows, input focus, z-order,…

Please don't say XLib does not, when in fact it does, and I have used it for that purpose. You can use it provides hints to the Window Manager (hence the WM). Don't just say shit like "does NOT" if you don't know for sure man. You could say "I'm not sure" or "XLib as far as I know", etc. I *have* used it for _NET_WM commands. Quite common actually, INCLUDING _NET_WM_STATE.

- Dennis

Anthony Walter wrote 49 lines
Actually XLib does NOT provide control over layering windows, input focus, z-order, virtual desktops. It's the window manager (KWin, Compiz, Metacity, IceWM, and so on) which handles this. As such, with some tookits and window manager combinations it's not possible to do certain things without special code to work around specific combinations of both. For example, when writing a Gtk2 application with Compiz it's not possible to alter the z-order of your application, ie bringing it to the foreground and/or activating it. XLib won't help you with this. But the good news is that most all window managers expose window management functionality through a common protocol: NetWM For example the _NET_WM_STATE message can be used to reorder the stack of application windows above or below one another (bringing your application to the top). It can be used to make your window sticky (to appear in the same place in all workspaces). The _NET_ACTIVE_WINDOW can be used to find application window with input focus. It can also be used to give input focus to another application window. These are all thing which XLib doesn't cover, and areas where Lazarus and some toolkits/window managers struggle with parity. That is, without a common protocol like NetWM. Anyhow, if anyone is still interested, I've written a Free Pascal unit to interface with the NetWM protocol. So far I've tested it with Gtk2 on Compix with the following functionality: Show/hide desktop [x] works Switch workspace [x] works Sticky/unsticky a window [x] works Move window to a different workspace [x] works Cycle various application z-orders [x] works I will implement a few more functions and then post the unit to github. I'd like to get application activation, bypassing window animations, and a few other features working. When posted if people with different window managers (KDE's KWin) want to test it, that would be great. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151029/eeefa41b/attachment.html>

Reply by email