Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
is_java = is_java_main or is_java_dialog
if not self.hidden:
# Never send TAKE_FOCUS on java *dialogs*
if not is_java_dialog and \
"WM_TAKE_FOCUS" in self.window.get_wm_protocols():
data = [
self.qtile.conn.atoms["WM_TAKE_FOCUS"],
xcffib.xproto.Time.CurrentTime,
0,
0,
0
]
u = xcffib.xproto.ClientMessageData.synthetic(data, "I" * 5)
e = xcffib.xproto.ClientMessageEvent.synthetic(
format=32,
window=self.window.wid,
type=self.qtile.conn.atoms["WM_PROTOCOLS"],
data=u
)
self.window.send_event(e)
# Never send FocusIn to java windows
if not is_java and self.hints['input']:
self.window.set_input_focus()
try:
if warp and self.qtile.config.cursor_warp:
self.window.warp_pointer(self.width // 2, self.height // 2)
except AttributeError:
pass
self.bar.height // 2 - self.icon_size // 2,
icon.width, self.icon_size,
0,
None
)
if icon.hidden:
icon.unhide()
data = [
self.qtile.conn.atoms["_XEMBED_EMBEDDED_NOTIFY"],
xcffib.xproto.Time.CurrentTime,
0,
self.bar.window.window.wid,
XEMBED_PROTOCOL_VERSION
]
u = xcffib.xproto.ClientMessageData.synthetic(data, "I" * 5)
event = xcffib.xproto.ClientMessageEvent.synthetic(
format=32,
window=icon.window.wid,
type=self.qtile.conn.atoms["_XEMBED"],
data=u
)
self.window.send_event(event)
xoffset += icon.width + self.padding
def kill(self):
if "WM_DELETE_WINDOW" in self.window.get_wm_protocols():
data = [
self.qtile.conn.atoms["WM_DELETE_WINDOW"],
xcffib.xproto.Time.CurrentTime,
0,
0,
0
]
u = xcffib.xproto.ClientMessageData.synthetic(data, "I" * 5)
e = xcffib.xproto.ClientMessageEvent.synthetic(
format=32,
window=self.window.wid,
type=self.qtile.conn.atoms["WM_PROTOCOLS"],
data=u
)
self.window.send_event(e)
else:
self.window.kill_client()
self.qtile.conn.flush()
self.screen = qtile.current_screen.index
self.bar = bar
atoms = qtile.conn.atoms
qtile.conn.conn.core.SetSelectionOwner(
win.wid,
atoms['_NET_SYSTEM_TRAY_S{:d}'.format(self.screen)],
xcffib.CurrentTime
)
data = [
xcffib.CurrentTime,
atoms['_NET_SYSTEM_TRAY_S{:d}'.format(self.screen)],
win.wid, 0, 0
]
union = ClientMessageData.synthetic(data, "I" * 5)
event = ClientMessageEvent.synthetic(
format=32,
window=qtile.root.wid,
type=atoms['MANAGER'],
data=union
)
qtile.root.send_event(event, mask=EventMask.StructureNotify)