bbidulock / icewm

A window manager designed for speed, usability, and consistency
Other
577 stars 98 forks source link

Focus on middle paste #649

Closed freonheat closed 2 years ago

freonheat commented 2 years ago

In (much) older versions of IceWM, when the user pastes into a window using middle-mouse, it would paste where the pointer is, but without giving that window focus. Now (using 2.5.0 and probably newer), it gives the target window focus, as if the mouse button 1 was pressed.

Old behavior: open LibreOffice document. Copy from Xterm that overlaps LO window. Paste using middle mouse into LO window, xterm continues to have focus. First mouse button clicking in LO gives it focus.

New behavior: open LibreOffice document. Copy from Xterm that overlaps LO window. Paste using middle mouse into LO window, LO gets focus and covers xterm. Must click back into xterm to regain focus.

Using all defaults (ClickToFocus=1) except these: ColorQuickSwitchActive="rgb:00/00/00" FocusRequestFlashTime=3 # [0-86400] MailCheckDelay=60 # [0-86400] MailCommand="launch none none taylor /aom/runs/clawsrun" OpaqueMove=0 # 0/1 OpaqueResize=0 # 0/1 PingTimeout=0 # [0-86400] ShowFocusModeMenu=0 # 0/1 ShowHelp=0 # 0/1 ShowLogoutSubMenu=0 # 0/1 ShowMoveSizeStatus=0 # 0/1 ShowSettingsMenu=0 # 0/1 ShowThemesMenu=0 # 0/1 ShowWorkspaceStatus=0 # 0/1 TaskBarEnableSystemTray=1 # 0/1 TaskBarMailboxStatusBeepOnNewMail=1 # 0/1 TaskBarMailboxStatusCountMessages=1 # 0/1 TaskBarShowCPUStatus=0 # 0/1 TaskBarShowMEMStatus=0 # 0/1 TaskBarShowNetStatus=0 # 0/1 TaskBarShowShowDesktopButton=0 # [0-2] TaskBarShowTransientWindows=1 # 0/1 TaskBarShowWindowListMenu=0 # 0/1 TaskBarShowWorkspaces=0 # 0/1 Theme="custom/default.theme" TimeFormat="%m/%d %l:%M%p" TitleBarMaximizeButton=2 # [0-5] TitleBarRollupButton=1 # [0-5] WorkspaceNames=" 1 "

Any idea when or why this changed or how to get the older behavior back? Thanks

gijsbers commented 2 years ago

Works fine here. Used xterm and guake. Overlaps with Libreoffice and Gedit. Paste a selection into lower LO or Gedit. Terminals remain raised and focused. Works with either Click or Sloppy focus. Check ButtonRaiseMask=1.

freonheat commented 2 years ago

We have ButtonRaiseMask=1 (the default)

I just tested it with xterm and Firefox and it is working fine with those. So this is likely something with LibreOffice here, not IceWM. Sorry. I will close this ticket and open a different one later if I can narrow it down better.

gijsbers commented 2 years ago

The question is if icewm or LO is causing the change in focus and raise. To examine that observe the output of: icesh -c libreoffice +r spy

freonheat commented 2 years ago

Wow, I didn't even know about icesh!

When I position the cursor on the non-focused libreoffice and middle-click to paste, it produces this:

52:49.277: 0x2e55086: Enter Normal Nonlinear Nofocus 52:49.565: 0x2e55086: Leave Grab Ancestor Nofocus 52:49.566: 0x2e55086: Enter Ungrab Ancestor Nofocus 52:49.768: 0x2e55086: Focus Normal Nonlinear 52:49.774: 0x00000b3: Configure 0x41689e 1066x883+107+57 Override Above=0x40217f 52:49.774: 0x2e55086: Visibility Unobscured 52:49.775: 0x2e55086: _NET_WM_STATE = _NET_WM_STATE_FOCUSED 52:49.851: 0x00000b3: _NET_CLIENT_LIST_STACKING = 0x1400022, 0x1e00003, 0x1a00003, 0x800022, 0x1000022, 0x2e4cbc2, 0x2200003, 0x2000003, 0x201ba5a, 0x3800022, 0x2e0001d, 0x3200003, 0x600022, 0x3400022, 0x2e55086 52:49.863: 0x2e55086: Configure 0x2e55086 1058x849+111+87 Send 52:49.863: 0x2e55086: _NET_WM_STATE = _NET_WM_STATE_FOCUSED 52:49.865: 0x00000b3: _NET_ACTIVE_WINDOW = 0x2e55086