Bug 695095 - WM_CLASS
Summary: WM_CLASS
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: X Display Driver (show other bugs)
Version: master
Hardware: PC Linux
: P4 enhancement
Assignee: Henry Stiles
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-15 19:50 UTC by James Cloos
Modified: 2020-12-30 09:08 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
Explicitly set the x11 device’s output window’s WM_CLASS property. (800 bytes, patch)
2014-03-15 19:50 UTC, James Cloos
Details | Diff
Set the WM_CLASS property when using the x11 DEVICEs. (1.47 KB, patch)
2014-04-22 20:55 UTC, James Cloos
Details | Diff
Avoid const warning when setting WM_CLASS. (1.15 KB, patch)
2014-04-23 09:34 UTC, James Cloos
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Cloos 2014-03-15 19:50:23 UTC
Created attachment 10750 [details]
Explicitly set the x11 device’s output window’s WM_CLASS property.

The attached patch adds an explicit call to XSetClassHint(1) to the x11 devices to ensure that the WM_CLASS property is set.

I have not been able to confirm whether XtOpenDisplay(1) or XtAppCreateShell(1) used to do that, or whether my window manager lost the ability to recognize windows based on WM_NAME, but setting WM_CLASS allows one to configure how gs’s output window behaves.

Contrary to the x11 devices, gtk+ sets the display device’s output window’s WM_CLASS based on the executable’s name.
Comment 1 Henry Stiles 2014-04-22 17:24:39 UTC
Thanks James, we'd prefer a patch in git "format-patch" but this is fine too if that's inconvenient.  If you are interested, we would offer a 500.00 bounty for scroll-bars on X11.  I notice you dabble in the X11 device and thought I'd ask.
Comment 2 Hin-Tak Leung 2014-04-22 17:53:02 UTC
(In reply to comment #1)
> ... scroll-bars on X11...

Scroll bars in X isn't an X thing but a widget/toolkit library thing. It would bring in additional dependencies; also, even just covering the 3(?) most common toolkits, athena (one of the more basic toolkit available on most unix platforms), and the more modern QT (KDE) and GTK (gnome, that covers Solaris as well, I think) is going to be a pain.

That said, it is probably easier to add scroll bars to the gsc/gsx binaries, since they already depends on GTK.

OTOH, it is not unthinkable to *bundle* a small widget library, like fltk, since gs already bundle a few 3rd party libraries...

That's the same reason why mupdf on X11 still hasn't got any scroll bars, btw.
Comment 3 James Cloos 2014-04-22 20:55:31 UTC
Created attachment 10843 [details]
Set the WM_CLASS property when using the x11 DEVICEs.

Here is a git format-patch version.
Comment 4 James Cloos 2014-04-22 21:03:35 UTC
Re scroll bars:

The gtk+ display device already has scroll bars (when needed).

Given the nature of the x11 devices, the athena toolkit would seem the best choice (minimal impact, similar vintage to the x11 code, ...).

I’ll have to remind myself of libXaw’s details,but I can do that.
Comment 5 James Cloos 2014-04-23 09:34:57 UTC
Created attachment 10848 [details]
Avoid const warning when setting WM_CLASS.

The warning from gcc is due to the fact that literal strings are now const char* rather than char*.

Avoid the warnings by casting the literals to char*.
Comment 6 James Cloos 2014-04-25 13:05:42 UTC
Adding scrollbars to the x displays will be straight-forward.

They already use Xt, so adding Xaw shouldn’t take much code.

But it will take some time to test.
Comment 7 Peter Cherepanov 2020-12-30 09:08:00 UTC
WM_CLASS property was added in 2014 by the commit ab862a5456.
Scroll bars are still missing, but this feature request is tracked as a bug 695198.