astier / xswm

Dead-simple X11-window-manager with only ONE TASK. Open every window maximized. ZERO CONFIGURATION required.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xterm takes a long time to launch and then instantly closes.

DuckInTub opened this issue · comments

Xterm doesn't behave properly in xswm. When launching Xterm from an application launcher like rofi (which uses the .desktop file in /usr/share/applications) Xterm takes a very long time to start, before appearing for just a moment and then instantly closing. This just appears as Xterm flashing past the screen a while after the launch was issued. There doesn't seem to be any errors from xterm itself. Launching xterm trough another terminal emulator (st) the command finishes silently after Xterm flashes by the screen. Starting Xterm from another tty or terminal emulator behaves similarly.

Info about packages and system:

The computer is running Void Linux x86_64 with kernel 6.8.6_1
xswm was built from the GitHub repository on 17th of April 2024.
xterm version is: xterm-382_1
rofi is a bare install of version of: rofi-1.7.5_1. Note tough that launching xterm from tty or st behaves likewise.

Here is the xterm.desktop file (without comments), which was auto generated when xterm installed:

[Desktop Entry]
Name=XTerm
#GenericName=Terminal
Comment=standard terminal emulator for the X window system
Exec=xterm
Terminal=false
Type=Application
Encoding=UTF-8
Icon=xterm-color_48x48
Categories=System;TerminalEmulator;
Keywords=shell;prompt;command;commandline;cmd;
StartupWMClass=XTerm

Here is a video of what it looks like trying to launch xterm from rofi:

out.mp4

NOTE: Launching Xterm trough other methods like a tty or another terminal emulator like st, behaves the same.
NOTE: St which also is a terminal emulator works fine and as expected.
NOTE: Launching Xterm in another window manager behaves like expected.

I can replicate this issue on my arch machine. I will look into it.

The closing of the window is caused by

xswm/main.c

Line 110 in c8118da

send_event(w, wm_atoms[TakeFocus]);

xswm should first check if WM_TAKE_FOCUS is in the WM_PROTOCOLS property before sending the event. The send_event() function should check in general if the respective protocol is supported by the client. However, xterm still opens slowly with a delay which I will have to figure out why.

fd225a6 should be the fix. However, as already mentioned xterm has a delay before opening. I will open a separate issue for this.

Could you please confirm if it fixes the xterm-crash? If it fixes the crash then does it still take a long time to load?

The delay should be fixed now too.