flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:

Home Page:https://flameshot.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pin works strange in dwm.

paradoxskin opened this issue · comments

https://github.com/flameshot-org/flameshot/assets/45301314/a436d754-1960-4d6c-a163-99b1ea3f041d
The video shows the following behaviors:

  1. Pin window is focused after click pin.
  2. The mouse focus event works differently when there is only one window left and when there are multiple windows.
  3. I can unfocus pin window, but I can't focus it again. After that I can only close by double clicking.
  4. Pin window can be seen under any tag.

I think it's the special features of the pin window that make it look weird in dwm.

This is xprop of Pin window (delete the icon content):

_NET_WM_USER_TIME(CARDINAL) = 3917451
XdndAware(ATOM) = BITMAP
WM_NAME(STRING) = 
_NET_WM_NAME(UTF8_STRING) = "flameshot"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x7e, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x1600008
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: True
		window id # of group leader: 0x1600008
WM_CLIENT_MACHINE(STRING) = "VAiO"
_NET_WM_PID(CARDINAL) = 38006
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 23068679
WM_CLASS(STRING) = "flameshot", "flameshot"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		user specified location: 1325, 206
		user specified size: 514 by 289
		program specified minimum size: 514 by 289
		window gravity: Static

I think you can reproduce it directly under the initial dwm.

2. The mouse focus event works differently when there is only one window left and when there are multiple windows.

When there is only one window, the mouse cannot focus and the focused window is always on the pin. Mouse focus can work when there are multiple windows, but it is actually wrong to display the focused border at the beginning.

It just like the Pin window is so different from the other windows.

Ok, I find the problem in src/tools/pin/pinwidget.cpp:71-73,

#if defined(Q_OS_LINUX)
      setWindowFlags(Qt::X11BypassWindowManagerHint); 
#endif

Just delete it. paradoxskin/flameshot/commit/053721