Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxterminal, xterm windows sporadically flash on task bar without reason #772

Closed
JanD1234 opened this issue Apr 23, 2024 · 24 comments
Closed

Comments

@JanD1234
Copy link

Hello.

I'm observing strange behavior of icewm and at least 2 terminals emulator I'm using - lxterminal and xterm. Sporadically it happens, that terminal windows start to flash on task bar every time the focus is changed from or to terminal window. The only way, how put the terminal window back to normal state is to use 'icesh urgent' command on the terminal window. This command, after initial flash, clears urgent flag from the window and it behaves normally afterwards.
I'm aware about this issue for some time, but I was not able to reproduce it reliably. Today I accidentally found out, that issue happens always, when I restart icewm with terminal windows opened. Download following recording for more information:
https://mail.upjs.sk/20240423_212449.mp4

Also terminals from other virtual desktop appears on task bar and flash after the restart. I set icewm to only show windows from the current virtual desktop on the task bar. This led me to believe, that the urgent flag is set for these windows.

icewm version: icewm-3.4.7
terminal emulators: lxterminal-0.4.0-bp154.1.86, xterm-330-150200.11.12.1
OS: OpenSuSE Leap 15.4
How to reproduce: see video in the link or description above
Note: I'm using focus follow mouse mode.

@gijsbers
Copy link
Collaborator

The video doesn't show properly. Can you make a screencast?

What focus model do you use? Does it work with Quiet Sloppy?

This is with TaskBarShowAllWindows=1? Can you try with the default preferences?

@JanD1234
Copy link
Author

JanD1234 commented Apr 24, 2024

Hello.

TaksBarShowAllWindows has default value 0.
Below is the preferences file I use. Let me know, what you want to change for retest.

ManualPlacement=1
UseMouseWheel=1
Win95Keys = 0
ModSuperIsCtrlAlt = 0
ClickToFocus = 0
FocusOnAppRaise = 1
RequestFocusOnAppRaise = 1
RaiseOnFocus = 1
RaiseOnClickClient = 1
PassFirstClickToClient = 0 # 0/1
FocusChangesWorkspace = 1
FocusOnMap = 1
FocusOnMapTransient = 1
FocusOnMapTransientActive = 1
MapInactiveOnTop = 1
PointerFocusDelay = 500
AutoRaiseDelay = 400
FocusRequestFlashTime=10 # [0-86400]

TaskBarAutoHide = 0
TaskBarShowMailboxStatus = 0
TimeFormat = "%a %d %b %R"
TaskBarShowCPUStatus = 0
TaskBarShowNetStatus = 0
TaskBarShowMEMStatus = 0

TerminalCommand = xterm.moj
LockCommand='xlock -nice 19 -mode blank'
ClockCommand = 'xclock -digital -padding 2 -twentyfour -strftime "%a %d %b %Y %H:%M" -face "*-8"'
SuspendCommand= 'test -e /run/systemd/system && syssuspend || loginctl suspend'
HibernateCommand= 'test -e /run/systemd/system && syshibernate || loginctl hibernate'

In addition, the focus_mode file:
#Focus mode (0=custom, 1=click, 2=sloppy, 3=explicit, 4=strict, 5=quiet)

FocusMode=0
#FocusMode=2
#FocusMode=0
#FocusMode=2
#FocusMode=0
#FocusMode=2

@gijsbers
Copy link
Collaborator

Using all your settings, I can't reproduce it! Nothing ever flashes...

You can set the ignoreUrgentHint winoption for xterm and lxterminal.

@JanD1234
Copy link
Author

JanD1234 commented Apr 24, 2024

Hello.

It is strange. But you can see on video, that it is happening. And for me, every time when I restart icewm.

I added
lxterminal.Lxterminal.ignoreUrgentHint: 1

to the winoptions file in ~/.icewm and restarted icewm, but no change. The same behavior as before. I tried also icesh winoptions, but the same result.

Update: There is a change. Now I cannot use icesh urgent command to stop flashing. I'm going to revert this option back, as it makes issue worse. :(

@JanD1234
Copy link
Author

I can create MS Teams meeting for debugging the issue if you give me e-mail address to invite.

@gijsbers
Copy link
Collaborator

Try icesh restore instead of icesh urgent. The former turns it off, the latter on.

Check FocusRequestFlashInterval and FocusRequestFlashTime.
icewm -p | grep RequestFlash. Set the latter to 0.

Run xprop WM_HINTS on the window that flashes.

@gijsbers
Copy link
Collaborator

Also set FocusOnAppRaise = 0.

@JanD1234
Copy link
Author

Hello.

The FlashTime is set 10 seconds as you can see from the preferences file I shared.
The FlashInterval is 250.

I set FlashTime to zero and result is that flashing is now indefinite and cannot be stopped with icesh restore|urgent.

xprop WM_HINTS
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x1a00007
bitmap id # of mask for icon: 0x1a00012
window id # of group leader: 0x1a00001
The urgency hint bit is set

icesh restore cannot stop flashing, only urgent works.

@JanD1234
Copy link
Author

With FocusOnAppRaise=0 no change.

@gijsbers
Copy link
Collaborator

Can you start from the default configuration?
If you use ~/.icewm, then just rename it to ~/icewm-backup.

@gijsbers
Copy link
Collaborator

The urgency hint bit is set

What sets that bit?

@JanD1234
Copy link
Author

This is good question. These terminals are open for approximately 2-3 days. I just tried to open the new one and it is without urgency bit set. And also does not flash after icewm restart. This is reason, why you cannot reproduce the issue.

So the question is how it happened, that these 3 terminals have this bit set? And how to clear it?

So it looks, that flashing after restart is only secondary reaction. The root cause is somewhere else.

@JanD1234
Copy link
Author

And why only terminals? Why I have not observed this with firefox, thunderbird or pavucontrol, which are permanently running on my desktop?

@JanD1234
Copy link
Author

Maybe I have an idea. Lxterminal has an option for visual bell. This is used in case, that PC does not have beeper. With lxterminal, the visual bell is translated to flashing of icon in task bar. Here is a proof. The new lxterminal window:

xprop WM_HINTS
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x1a59a2e
bitmap id # of mask for icon: 0x1a59a34
window id # of group leader: 0x1a00001

The same lxterminal window, after visual bell was used:

xprop WM_HINTS
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x1a59a2e
bitmap id # of mask for icon: 0x1a59a34
window id # of group leader: 0x1a00001
The urgency hint bit is set

So it looks, that urgency flag is not cleared after it is used for visual bell. Is clearing of urgent flag responsibility of WM or application?

@gijsbers
Copy link
Collaborator

It is the responsibility of the application according to section 4.1.2.4 of http://www.x.org/docs/ICCCM/icccm.pdf:
Clients must provide some means by which the user can cause the UrgencyHint flag to be set to zero or the window to be withdrawn. The user’s action can either mitigate the actual condition that made the window urgent, or it can merely shut off the alarm.

@gijsbers
Copy link
Collaborator

Lxterminal never turns the urgency flag off. That is clearly a bug in lxterminal.

@gijsbers
Copy link
Collaborator

Changes 2dadb9b and f59682c let icesh and icewm increase control of the urgency flag.

@JanD1234
Copy link
Author

Hello.

I can confirm, that after applying patches, icesh urgent and restore commands clear urgency hint.
After the visual bell is used in lxterminal window, the urgency hint stays set on this window.
After restart of the icewm, the urgency bit is cleared from the lxterminals after they flash.

@gijsbers
Copy link
Collaborator

The question now is, is this a desirable feature or not? Nowhere in the ICCCM spec does it say that a WM should clear this flag. Lxterminal may be the only application which has this bug. If you want all WMs to support this erratic behavior, you have to inform all 367 WMs out there and update the spec. We may just as well remove this new code from IceWM and let lxterminal users suffer a bit until they report the bug to the lxterminal developers.

@JanD1234
Copy link
Author

JanD1234 commented May 2, 2024

Hello.

I have created a ticket for lxterminal. Let us wait for lxde developers reaction.
https://sourceforge.net/p/lxde/bugs/969/

@gijsbers
Copy link
Collaborator

gijsbers commented May 2, 2024

Thanks! Urxvt has this cool option, which is spot on!

   urgentOnBell: boolean
       True: set the urgency hint for the wm on receipt of a bell
       character.  False: do not set the urgency hint [default].

       urxvt resets the urgency hint on every focus change.

Sakura and XTerm also work correctly. So does xfce4-terminal.

@gijsbers gijsbers closed this as completed May 7, 2024
@JanD1234
Copy link
Author

JanD1234 commented May 8, 2024

I tried Sakura, it works in the same way as lxterminal.
New Sakura window:

xprop WM_HINTS
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
window id # of group leader: 0x1200001

The same window after visual bell (called urgency bell in Sakura):

xprop WM_HINTS
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
window id # of group leader: 0x1200001
The urgency hint bit is set

It does not help, when I change focus, the urgency hint is still active.

And after icewm restart, also the Sakura icon blinks, until icewm clears the urgency hint.

@gijsbers
Copy link
Collaborator

What version of sakura is that?
My tests went fine and the source code of sakura looks good too.

@JanD1234
Copy link
Author

This one:

Information for package sakura:

Repository : openSUSE-Leap-15.4-1
Name : sakura
Version : 3.8.2-bp154.1.77
Arch : x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants