thestinger / termite

Termite is obsoleted by Alacritty. Termite was a keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.
https://github.com/alacritty/alacritty
2.73k stars 240 forks source link

Window properties (including --name) not specified in swaywm #644

Closed khughitt closed 5 years ago

khughitt commented 5 years ago

Note

This may be a termite issue, or a non-issue, but I thought I would report in full here for clarification since I suspect others are likely to run into the same issue.

Overview

When attempting to configure sway to silently create a couple terminal scratchpad instances at launch (separate issue, but also happy to hear any suggestions about plausibility / implementation), I was unable to get any rules relating to application instance or class to apply properly to the terminal application termite.

Upon closer inspection, it appears that the window field is set to null and window_properties is not specified at all.

For comparison, the same procedure was run with a second X-based terminal application, st, and both window and window_properties were found to be specified as expected.

Termite's lack of support for handling window class in wayland has been previously reported (1 and 2), and appears to be expected for behavior for native wayland apps.

Questions

  1. Since --name also handles specifying a WM_CLASS property, is this also expected behavior?
  2. Is there anything similar to WM_CLASS for native wayland apps? The fact that window_properties is handled for the non-native applications, but not native ones seems counter-intuitive and has the result that controlling the behavior of X apps is easier than controlling the behavior of wayland apps.

Steps to reproduce

Starting with a clean config file (only specified terminal):

  1. Launch sway
  2. Open a terminal instance
  3. Run termite with flags specifying window name, title and class:
termite --name=termite_name --title=temite_title --class=temite_class
  1. swaymsg -t get_tree > ~/sway_termite.json
  2. Close second termite instance
  3. Run st with similar parameters:
st -c st_class -n st_name -t st_title
  1. swaymsg -t get_tree > ~/sway_st.json

termite window entry:

{
"id": 7,
"name": "termite_title",
"rect": {
    "x": 2880,
    "y": 23,
    "width": 960,
    "height": 1057
},
"focused": true,
"focus": [
],
"border": "normal",
"current_border_width": 2,
"layout": "none",
"orientation": "none",
"percent": 0.5,
"window_rect": {
    "x": 2,
    "y": 0,
    "width": 956,
    "height": 1030
},
"deco_rect": {
    "x": 0,
    "y": 0,
    "width": 960,
    "height": 25
},
"geometry": {
    "x": 0,
    "y": 0,
    "width": 814,
    "height": 458
},
"window": null,
"urgent": false,
"floating_nodes": [
],
"sticky": false,
"type": "con",
"pid": 30841,
"app_id": "termite_name",
"marks": [
],
"nodes": [
]
}

st window entry

{
"id": 8,
"name": "swaymsg",
"rect": {
    "x": 2880,
    "y": 23,
    "width": 960,
    "height": 1057
},
"focused": true,
"focus": [
],
"border": "normal",
"current_border_width": 2,
"layout": "none",
"orientation": "none",
"percent": 0.5,
"window_rect": {
    "x": 2,
    "y": 0,
    "width": 956,
    "height": 1030
},
"deco_rect": {
    "x": 0,
    "y": 0,
    "width": 960,
    "height": 25
},
"geometry": {
    "x": 0,
    "y": 0,
    "width": 564,
    "height": 340
},
"window": 6291461,
"urgent": false,
"floating_nodes": [
],
"sticky": false,
"type": "con",
"pid": 31082,
"app_id": null,
"marks": [
],
"window_properties": {
    "class": "st_class",
    "instance": "st_name",
    "title": "swaymsg",
    "transient_for": null
},
"nodes": [
]
}

Debug log: https://gist.github.com/khughitt/361c7bade4d06e25bca5869d42a0a890

System info:

khughitt commented 5 years ago

Whoops..Meant to post this on the sway issue tracker 😅.. It does relate to both sway and termite, but I think it may be more relevant for that tracker. Closing issue here.

khughitt commented 5 years ago

Reported here: https://github.com/swaywm/sway/issues/3122