Skip to content

Libreoffice does not get focus when opening new window in existing instanceΒ #833

Description

@PetteriAimonen

Steps to reproduce:

  1. Start lowriter and observe the splash screen appear and the window gets focus.
  2. Focus two other windows, so that you get window manager events that do not involve the lowriter window.
  3. Start lowriter and observe no splash screen (because there is existing instance) and that the new window does not get focus.

Based on git bisect, this behavior started after icewm commit 0499fce.

However I'm not sure if it is icewm or libreoffice bug.
Checking the timestamps it seems that libreoffice is taking the userTime for its new window from the last event its existing instance has received.

# Window events involving other programs happen, window manager user time gets updated
21:36:03  YFrameClient::getUserTime 0x5617a55d7d30 2331641134
21:36:03  YWindowManager::updateUserTime 2331641134

# Libreoffice window opens, it has _NET_WM_USER_TIME_WINDOW set and that window has old timestamp
21:36:06  UserTimeWindow 2331637953
21:36:06  YFrameClient::getUserTime 0x5617a5627240 2331637953

# The timestamp from libreoffice is 4 seconds in the past from managerTime, 7 seconds past in real time 
21:36:06  updateFocusOnMap client=0x5617a5627240 userTime=2331637953 managerTime=2331641134 doActivate=0

# After clicking on the libreoffice window it gets new time
21:36:20  UserTimeWindow 2331657463
21:36:20  YFrameClient::getUserTime 0x5617a5627240 2331657463

The libreoffice window has _NET_WM_USER_TIME_WINDOW set and icewm appears to be using it.
Prior to 0499fce this apparently didn't work correctly, so in a sense icewm is now working properly.

I have confirmed that if I disable the check for getUserTimeWindow() in YFrameClient::getUserTime(), then libreoffice gets focus correctly.
Presumably because the libreoffice main window does not have user time and then icewm just always gives the focus.

But I'm still confused why libreoffice works ok with other window managers.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions