Skip to content

Sometimes no focus on new window #37

@williex

Description

@williex

When a new program is started, icewm sometimes fails to properly focus it. A way for me to reproduce 100%:

  1. Start audacious (music player) on desktop 1
  2. Press Ctrl+J, an audacious dialog window appears
  3. Switch to desktop 2, by keyboard or mouse, doesn't matter.
  4. I press the key Ctrl+Alt+a which I have defined as:
    key "Ctrl+Alt+a" xfce4-terminal
    Or I start a terminal from the menu or start a terminal from the quicklaunch, it doesn't matter.
  5. The new terminal window does not get focus, it does have the urgency bit set and starts flashing in the taskbar.

The same problem happens with firefox or chromium and seems to happen when there is already a firefox or chromium window running somewhere and a new window is opened.

This problem does not happen in icewm 1.3.8. I've tracked it down to commit a57ec4f. The following patch fixes the problem for me. It's a terrible patch because it completely ignores the new timing code but my X knowledge is too limited to completely understand the code in updateNetWMUserTime

--- icewm-1.3.10.bak/src/wmframe.cc 2015-07-03 03:38:11.000000000 +0200
+++ icewm-1.3.10/src/wmframe.cc 2015-08-15 12:15:08.763321027 +0200
@@ -1851,9 +1851,9 @@
             doActivate = false;
     }

-    if (fUserTime != -1UL)
+/*    if (fUserTime != -1UL)
         if (fUserTime == 0 || fUserTime != manager->lastUserTime())
-            doActivate = false;
+            doActivate = false;*/
 }

 void YFrameWindow::wmShow() {

Metadata

Metadata

Assignees

Labels

bugThe issue exposes a bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions