Skip to content

Commit

Permalink
#1207: try harder to supply a valid time to use with the menu popup f…
Browse files Browse the repository at this point in the history
…unction

git-svn-id: https://xpra.org/svn/Xpra/trunk@13761 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 16, 2016
1 parent 76dfdc9 commit 6d3551a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 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 @@ -316,9 +316,9 @@ def close_menu(self, *args):
def menu_deactivated(self, *args):
self.menu_shown = False

def activate(self):
log("activate()")
self.show_menu(1, 0)
def activate(self, button=1, time=0):
log("activate(%s, %s)", button, time)
self.show_menu(button, time)

def popup(self, button, time):
log("popup(%s, %s)", button, time)
Expand Down
4 changes: 2 additions & 2 deletions src/xpra/client/gtk_base/statusicon_tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def popup_menu(self, widget, button, time, *args):
log("popup_menu(%s, %s, %s, %s)", widget, button, time, args)
self.may_guess()
if self.click_cb:
self.click_cb(button, 1, 0)
self.click_cb(button, 0, 0)
self.click_cb(button, 1, time)
self.click_cb(button, 0, time)


def hide(self, *args):
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def setup_xpra_tray(self, tray_icon_filename):
def xpra_tray_click(button, pressed, time=0):
traylog("xpra_tray_click(%s, %s, %s)", button, pressed, time)
if button==1 and pressed:
self.idle_add(self.menu_helper.activate)
self.idle_add(self.menu_helper.activate, button, time)
elif button==3 and not pressed:
self.idle_add(self.menu_helper.popup, button, time)
def xpra_tray_mouseover(*args):
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/server/shadow/gtk_shadow_server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def tray_click_callback(self, button, pressed, time=0):
traylog("tray_click_callback(%s, %s)", button, pressed)
if pressed:
self.close_tray_menu()
self.tray_menu.popup(None, None, None, button, 0)
self.tray_menu.popup(None, None, None, button, time)
self.tray_menu_shown = True

def tray_exit_callback(self, *args):
Expand Down

0 comments on commit 6d3551a

Please sign in to comment.