Skip to content

Commit

Permalink
we don't need the "view-to-window" mapping unless we're doing wheel e…
Browse files Browse the repository at this point in the history
…vents via gdk_bindings (which isn't ported to GTK3 yet)

git-svn-id: https://xpra.org/svn/Xpra/trunk@17878 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jan 4, 2018
1 parent 1722dd0 commit bd383ae
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/xpra/platform/darwin/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,26 +522,28 @@ def cb(menu_item):

def add_window_hooks(window):
window.connect("focus-in-event", window_focused)
global VIEW_TO_WINDOW
try:
gdkwin = window.get_window()
VIEW_TO_WINDOW[gdkwin.nsview] = window
except:
log("add_window_hooks(%s)", window, exc_info=True)
log.error("Error: failed to associate window %s with its nsview", window, exc_info=True)
if WHEEL and PYTHON2:
global VIEW_TO_WINDOW
try:
gdkwin = window.get_window()
VIEW_TO_WINDOW[gdkwin.nsview] = window
except:
log("add_window_hooks(%s)", window, exc_info=True)
log.error("Error: failed to associate window %s with its nsview", window, exc_info=True)

def remove_window_hooks(window):
try:
del window_menus[window]
except:
pass
global VIEW_TO_WINDOW
#this should be redundant as we use weak references:
try:
gdkwin = window.get_window()
del VIEW_TO_WINDOW[gdkwin.nsview]
except:
pass
if WHEEL and PYTHON2:
global VIEW_TO_WINDOW
#this should be redundant as we use weak references:
try:
gdkwin = window.get_window()
del VIEW_TO_WINDOW[gdkwin.nsview]
except:
pass


def _set_osx_window_menu(add, wid, window, menus, application_action_callback=None, window_action_callback=None):
Expand Down

0 comments on commit bd383ae

Please sign in to comment.