dimmer: remove previous tentative to detect i3lock

This commit is contained in:
Vincent Bernat 2021-08-06 21:57:00 +02:00
parent ad1fa52a73
commit b05514177f

View file

@ -8,17 +8,11 @@
import gi import gi
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
gi.require_version("Wnck", "3.0") from gi.repository import Gtk, Gdk, GLib
from gi.repository import Gtk, Gdk, GLib, Wnck
import cairo import cairo
import argparse import argparse
def on_window_opened(screen, window, options):
if window.get_class_group_name() == options.quit_when:
Gtk.main_quit()
def on_realize(widget): def on_realize(widget):
window = widget.get_window() window = widget.get_window()
window.set_override_redirect(True) window.set_override_redirect(True)
@ -75,7 +69,6 @@ if __name__ == "__main__":
options = parser.parse_args() options = parser.parse_args()
display = Gdk.Display.get_default() display = Gdk.Display.get_default()
screen = Wnck.Screen.get_default();
for i in range(display.get_n_monitors()): for i in range(display.get_n_monitors()):
geom = display.get_monitor(i).get_geometry() geom = display.get_monitor(i).get_geometry()
once = [] once = []
@ -92,7 +85,6 @@ if __name__ == "__main__":
window.connect("draw", on_draw, options, []) window.connect("draw", on_draw, options, [])
window.connect("delete-event", Gtk.main_quit) window.connect("delete-event", Gtk.main_quit)
window.connect("realize", on_realize) window.connect("realize", on_realize)
screen.connect("window-opened", on_window_opened, options)
window.show_all() window.show_all()