LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-21-2021, 08:50 PM   #1
pisti
Member
 
Registered: Jul 2006
Location: Montréal, Canada
Distribution: Slackware
Posts: 258

Rep: Reputation: 33
focus stealing by xterm/tmux in Slackware -current


since i installed Slackware -current (a year ago) i have this problem of focus stealing by one single xterm window inside a fvwm session. i ssh from that xterm window to my main server where i connect to a tmux session. within tmux i run various applications from which one seems to be associated with this focus stealing problem, that is actions or activities (messages and such) within the alpine mail client.

you can imagine that this is a very annoying problem : you type in any window and suddenly the focus falls on that xterm/tmux window with unpleasant consequences, depending on which pane or window is active within tmux, that need to be un-done somehow.

now, the chain is long, and i don't know who is the culprit : tmux, xterm, fvwm or alpine - decreasing in that order ? but this problem surfaced after the Slack-Current installation on the local machine, so that would again point it on fvwm or xterm ? who can help ?

Last edited by pisti; 07-23-2021 at 10:22 AM.
 
Old 07-22-2021, 05:56 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
I know xterm has some control-sequences for letting an application know whether it gains/loses focus, but I'm not aware of any that let it grab focus (which is generally frowned upon by X11 application guidelines).

alpine/tmux shouldn't be able to interact with anything outside of their tty/the terminal window. What they can do is issue a ^G (bell character) and depending on how xterm is configured that can be interpreted as a signal to set the "Urgency" hint on the window, which in turn a window manager can act on depending on its own configuration and default behaviours. Maybe something in your fvwm config is set to focus windows going into an 'Urgent' state, but it doesn't happen here with my fvwm config (which is a modified version of the one shipped with slackware), and bellIsUrgent defaults to false in xterm anyway, so that would mean there are two non-default values that would need to be set for this to be the reason.

Kind of clutching at straws here, can't think of any other possible explanation. I'll be interested to hear what it is if you manage to track it down.
 
1 members found this post helpful.
Old 07-22-2021, 09:30 AM   #3
notzed
Member
 
Registered: Dec 2020
Location: South Australia
Distribution: slackware64-current
Posts: 95

Rep: Reputation: Disabled
Well when in doubt check the man page.

And lo ... it turns out there ARE control sequences for window ordering: https://invisible-island.net/xterm/c...s;Ps;Ps-t.1EB0 (wtf?).

/etc/X11/app-defaults/XTerm contains these lines but it seems to be disabled by default anyway:

Code:
! Depending on your environment, you may wish to disable those by default by
! uncommenting one or more of the resource settings below:
!*allowFontOps: false
!*allowTcapOps: false
!*allowTitleOps: false
!*allowWindowOps: false
If it's enabled somehow it's probably that plus a window manager setting that causes it to grab focus, I haven't used fvwm for about 25 years so I can't help there. These are also in the Ctrl-RMB menu at the bottom.

Or it could just be the bell (\b, 0x07) and the window manager as already hypothesised. This resource seems related - and should also be off by default - https://invisible-island.net/xterm/m...rces:popOnBell This and some other bell related options are in the Ctrl-MMB about half way down.
 
2 members found this post helpful.
Old 07-22-2021, 09:36 AM   #4
notzed
Member
 
Registered: Dec 2020
Location: South Australia
Distribution: slackware64-current
Posts: 95

Rep: Reputation: Disabled
There also seems to be a lot of tmux options related to bells and monitoring term clients.
 
1 members found this post helpful.
Old 07-22-2021, 09:55 AM   #5
pisti
Member
 
Registered: Jul 2006
Location: Montréal, Canada
Distribution: Slackware
Posts: 258

Original Poster
Rep: Reputation: 33
thank you for your suggestions ! regarding the beep or C-g, i will try to stop that in Alpine by enabling :

Code:
[x]  Suppress Status Message Beeping
here the related Alpine help :

Quote:
This feature affects Alpine's behavior when it displays status message (e.g., Error complaints, New mail warnings, etc). Setting this feature will not affect the display of such messages, but will cause those that emit a beep to become silent.
let's hope that will do it. as said i experience this issue just on that one single machine with a one-year-old Slack-Current installation but interestingly nowhere else where i run the Slackware/fvwm and this ssh/tmux/alpine scenario. i will return to that problem machine tonight and will see if the situation improved. will keep you posted...
 
1 members found this post helpful.
Old 07-22-2021, 09:55 AM   #6
pisti
Member
 
Registered: Jul 2006
Location: Montréal, Canada
Distribution: Slackware
Posts: 258

Original Poster
Rep: Reputation: 33
thank you for your suggestions ! regarding the beep or C-g, i will try to stop that in Alpine by enabling :

Code:
[x]  Suppress Status Message Beeping
here the related Alpine help :

Quote:
This feature affects Alpine's behavior when it displays status message (e.g., Error complaints, New mail warnings, etc). Setting this feature will not affect the display of such messages, but will cause those that emit a beep to become silent.
let's hope that will do it. as said i experience this issue just on that one single machine with a one-year-old Slack-Current installation but interestingly nowhere else where i run the Slackware/fvwm and this ssh/tmux/alpine scenario. i will return to that problem machine tonight and will see if the situation improved. will keep you posted...
 
1 members found this post helpful.
Old 07-22-2021, 04:44 PM   #7
pisti
Member
 
Registered: Jul 2006
Location: Montréal, Canada
Distribution: Slackware
Posts: 258

Original Poster
Rep: Reputation: 33
quelling the Alpine beep did it - no more grabbing, no more stealing of the window focus ! thank you for your suggestions. marking this solved...
 
3 members found this post helpful.
Old 07-23-2021, 10:14 AM   #8
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Just to correct a comment I made above, seems Slackware's xterm does indeed have bellIsUrgent set 'true' by default in its app-defaults file — I was on my CRUX system when I posted so couldn't check, but I should have done so before posting.

And fvwm does have a built-in function that responds to the urgency hint as follows:
Code:
DestroyFunc UrgencyFunc
AddToFunc UrgencyFunc
+ I Iconify off
+ I FlipFocus
+ I Raise
+ I WarpToWindow 5p 5p
So, this one seems to be fully explained now.

Finally, a small nit-pick of notzed post: bell is \a not \b (which is backspace), but everything else he said is otherwise correct.
 
2 members found this post helpful.
Old 07-23-2021, 10:42 AM   #9
pisti
Member
 
Registered: Jul 2006
Location: Montréal, Canada
Distribution: Slackware
Posts: 258

Original Poster
Rep: Reputation: 33
thank you for all this information, one never stops learning...!

the funny part here is that i use an ~/.fvwmrc file i had created perhaps some two decades ago. it practically never changed over the years except for minimal necessary adjustments. originally i had created it for fvwm v1, and i am with every upgrade surprised that this old RC file continues working with the newest fvwm versions. the new ones look entirely different. there is for example no UrgencyFunc in my old fvwmrc file though it was perhaps called differently at that time.

i speculate here that with that OS upgrade to -Current on my local machine a year ago something changed for XTERM or FVWM locally because TMUX/ALPINE reside remotely on the server and were surely not affected by this upgrade.

in any case, i leave it as it is. the issue was stopped within Alpine, while we leave this way this UrgencyFunc axis operational.
 
Old 07-23-2021, 11:13 AM   #10
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
The defaults for XTerm did change at some point during this current development cycle. The main change was from the default black on white, to something that more closely reflects the look of the linux virtual console, but it looks like the Urgency hint setting came along for the ride.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse Over Focus Stealing HOW TO TURN OFF Brad.Scalio@noaa.gov Linux - Desktop 3 07-16-2007 02:28 PM
Focus Stealing Across Desktops - Firefox/Thunderbird vtel57 Linux - General 0 05-18-2007 02:06 PM
Focus Stealing Across Desktops - Firefox/T-bird vtel57 Linux - Desktop 0 05-15-2007 12:24 PM
How to stop gaim stealing focus? chrism01 Linux - Software 4 05-26-2006 12:40 AM
Gnome stealing focus, only able to navigate with tab and enter stalefries Ubuntu 2 07-05-2005 02:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration