[Lazarus] window classes according to WM

David Emerson dle3ab at angelbase.com
Wed Sep 14 06:22:00 CEST 2011


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.

On Mon 12 Sep 2011, 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?
> > 
> > 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
> 
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
> 







More information about the Lazarus mailing list