processing4 icon indicating copy to clipboard operation
processing4 copied to clipboard

P2D and P3D renderers don't set `WM_CLASS` for Linux

Open ColdMacaroni opened this issue 2 years ago • 2 comments

Description

When running a sketch that uses the P2D or P3D renderer. The WM_CLASS window variable is not set. This makes it difficult (impossible?) to set window rules for the resulting window. (For example, making it so a tiling window manager makes the window float by default, instead of resizing it.)

Expected Behavior

WM_CLASS should be set to "Processing", "processing-sketch" or similar. For reference, the main processing app has a WM_CLASS of "Processing", "Processing" and a sketch with the default renderer has a WM_CLASS of "processing-core-PApplet", "processing-core-PApplet".

Current Behavior

The WM_CLASS variable is not set. (I don't mean empty, it just doesn't exist)

Steps to Reproduce

  1. Run a sketch that uses P2D or P3D as a renderer. Example code:
size(128, 128, P2D);
  1. Inspect the window class with xprop (or another similar tool). To use xprop, simply run it on a terminal and click on the window. You can also pipe it into grep to filter out the other variables: xprop | grep WM_CLASS

Your Environment

  • Processing version: 4.3 (1293)
  • Operating System and OS version: Arch Linux (kernel 6.4.12-arch1-1)
  • Other information:
    • Xorg server version: 21.1.8
    • Tested with the following window managers:
      • AwesomeWM
      • XMonad
      • Hyprland (through XWayland)

ColdMacaroni avatar Aug 29 '23 07:08 ColdMacaroni

I tested with xprop command on linux as follow

xprop -name "sketch_231214a" -f WM_CLASS 8s -set WM_CLASS "Processing" 

image

and confirmed that WM_CLASS added on canvas(running window). now I'm researching how can I add this on source code.

icq4ever avatar Dec 13 '23 17:12 icq4ever

https://stackoverflow.com/a/29218320 this thread show where can start point. and similar codes already added here . hmm..

https://github.com/kfeuz/processing/commit/3f79ddddb316a9c1abc20f2e8a3514a344611a49?diff=unified&w=0#diff-6428616152344f7571cc03d4749adf9c77757cd02f9e4c1ccffc0f843d392388

this is the main sketch window maybe ?

icq4ever avatar Dec 13 '23 17:12 icq4ever