Sign in Join

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

Mailing lists / lazarus / 2011-09

window classes according to WM

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

David Emerson

Hi all,

What is the property that determines the window class, as seen by the WM / xorg?

I'm asking for the purpose of grouping: I'd like to be able to have distinct groups of windows that the WM will group independently of one another.

As an example, looking at the easter/holydays example, if I use KDE3's edit window-specific settings dialog I can detect window properties. It shows me

Class: Holyday (holyday Holyday)

and some other stuff. My assumption is that the class is used by the WM to determine which windows are grouped together.

The real reason I'm asking is that in fpgui, the class is undefined and I'd like to find out how it's done in lazarus, where it IS defined.

Cheers,
David.

Reply by email

Andrew Haines
to David Emerson
David Emerson wrote 22 lines
Hi all, What is the property that determines the window class, as seen by the WM / xorg? I'm asking for the purpose of grouping: I'd like to be able to have distinct groups of windows that the WM will group independently of one another. As an example, looking at the easter/holydays example, if I use KDE3's edit window-specific settings dialog I can detect window properties. It shows me Class: Holyday (holyday Holyday) and some other stuff. My assumption is that the class is used by the WM to determine which windows are grouped together. The real reason I'm asking is that in fpgui, the class is undefined and I'd like to find out how it's done in lazarus, where it IS defined. Cheers, David.

Lazarus uses other toolkits in linux (gtk, qt) which set these hints already. So no special steps are done with lazarus to set the windows class. The toolkit does it for us.

You can set the class on a window using the Xlib function XAllocClassHint

Here's the manual page for this function
http://www.xfree86.org/current/XAllocClassHint.3.html

see especially
http://www.xfree86.org/current/XAllocClassHint.3.html#toc5

The first param is the program name and the second is the class name you want.

Lastly here's a c example of it's use
http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkwindow-x11.c#n834

You have to set the class just after the XWindow is created and before it is shown.

Regards,

Andrew

PS I found all this searching google for: x11 window class grouping

Reply by email

Martin Schreiber
to David Emerson: What is the property that determines the window class, as seen by the WM / xorg? I'm…
David Emerson wrote 13 lines
What is the property that determines the window class, as seen by the WM / xorg? I'm asking for the purpose of grouping: I'd like to be able to have distinct groups of windows that the WM will group independently of one another. As an example, looking at the easter/holydays example, if I use KDE3's edit window-specific settings dialog I can detect window properties. It shows me Class: Holyday (holyday Holyday) and some other stuff. My assumption is that the class is used by the WM to determine which windows are grouped together.

"Client to Window Manager Commmunication" is documented here: http://tronche.com/gui/x/icccm/sec-4.html

MSEgui additionally uses the WM_CLIENT_LEADER property, see lib/common/i386-linux/mseguiintf.pas, gui_createwindow().

Martin

Reply by email

David Emerson
to Andrew Haines: Lazarus uses other toolkits in linux (gtk, qt) which set these hints already. So no…

Thanks so much, Andrew. I couldn't possibly wish for a more concise and complete explanation; wish my own research had been as fruitful!

Thanks to you, too, Martin.

~David.

Andrew Haines wrote
On 09/12/11 21:59, David Emerson wrote: > Hi all, > > What is the property that determines the window class, as seen by the WM /

xorg?

Show quoted text 13 lines
> > I'm asking for the purpose of grouping: I'd like to be able to have distinct > groups of windows that the WM will group independently of one another. > > As an example, looking at the easter/holydays example, if I use KDE3's edit > window-specific settings dialog I can detect window properties. It shows me > > Class: Holyday (holyday Holyday) > > and some other stuff. My assumption is that the class is used by the WM to > determine which windows are grouped together. > > The real reason I'm asking is that in fpgui, the class is undefined and I'd

like

Show quoted text 40 lines
> to find out how it's done in lazarus, where it IS defined. > > Cheers, > David. > > Lazarus uses other toolkits in linux (gtk, qt) which set these hints already. So no special steps are done with lazarus to set the windows class. The toolkit does it for us. You can set the class on a window using the Xlib function XAllocClassHint Here's the manual page for this function http://www.xfree86.org/current/XAllocClassHint.3.html see especially http://www.xfree86.org/current/XAllocClassHint.3.html#toc5 The first param is the program name and the second is the class name you want. Lastly here's a c example of it's use http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkwindow-x11.c#n834 You have to set the class just after the XWindow is created and before it is shown. Regards, Andrew PS I found all this searching google for: x11 window class grouping -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email