Skip to content

Commit

Permalink
#724: safer workaround for buggy win32 tray behaviour: use an idle_ad…
Browse files Browse the repository at this point in the history
…d timer to check if we need to patch things up, and prevent unnecessary toggles

git-svn-id: https://xpra.org/svn/Xpra/trunk@9002 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 14, 2015
1 parent 84eb099 commit 17a3683
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/xpra/client/gtk_base/gtk_tray_menu_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ def __init__(self, label, tooltip=None):

def on_button_release_event(self, *args):
log("TrayCheckMenuItem.on_button_release_event(%s) label=%s", args, self.label)
self.set_active(True)
self.toggled()
self.active_state = self.get_active()
def recheck():
state = self.active_state
self.active_state = None
if state is not None and state==self.get_active():
#toggle did not fire after the button release, so force it:
self.set_active(not state)
gobject.idle_add(recheck)


def make_min_auto_menu(title, min_options, options, get_current_min_value, get_current_value, set_min_value_cb, set_value_cb):
Expand Down Expand Up @@ -546,7 +552,7 @@ def gl_set(*args):
gl.set_tooltip_text("no server support for runtime switching")
return
def opengl_toggled(*args):
log("opengl_toggled%s", args)
log.info("opengl_toggled%s", args)
self.client.toggle_opengl()
gl.connect("toggled", opengl_toggled)
self.client.connect("handshake-complete", gl_set)
Expand Down

0 comments on commit 17a3683

Please sign in to comment.