Skip to content

Commit

Permalink
#772: if no buttons are set as triggers, keep track of the active but…
Browse files Browse the repository at this point in the history
…tons at the start and stop the moveresize when any of those buttons state changes

git-svn-id: https://xpra.org/svn/Xpra/trunk@13723 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 14, 2016
1 parent 7a0a5ae commit dafe5c6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/xpra/client/gtk_base/gtk_client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,10 +918,14 @@ def call_action(self, action_type, action, state, pdata):

def do_motion_notify_event(self, event):
if self.moveresize_event:
x_root, y_root, direction, button, wx, wy, ww, wh = self.moveresize_event
x_root, y_root, direction, button, start_buttons, wx, wy, ww, wh = self.moveresize_event
dirstr = MOVERESIZE_DIRECTION_STRING.get(direction, direction)
buttons = self._event_buttons(event)
if button>0 and button not in buttons:
if start_buttons is None:
#first time around, store the buttons
start_buttons = buttons
self.moveresize_event[4] = buttons
if (button>0 and button not in buttons) or (button==0 and start_buttons!=buttons):
geomlog("%s for window button %i is no longer pressed (buttons=%s) cancelling moveresize", dirstr, button, buttons)
self.moveresize_event = None
else:
Expand Down Expand Up @@ -1003,7 +1007,7 @@ def do_moveresize(self):


def initiate_moveresize(self, x_root, y_root, direction, button, source_indication):
statelog("initiate_moveresize%s", (x_root, y_root, MOVERESIZE_DIRECTION_STRING.get(direction, direction), button, SOURCE_INDICATION_STRING.get(source_indication, source_indication)))
statelog.warn("initiate_moveresize%s", (x_root, y_root, MOVERESIZE_DIRECTION_STRING.get(direction, direction), button, SOURCE_INDICATION_STRING.get(source_indication, source_indication)))
if MOVERESIZE_X11 and HAS_X11_BINDINGS:
self.initiate_moveresize_X11(x_root, y_root, direction, button, source_indication)
return
Expand All @@ -1014,7 +1018,7 @@ def initiate_moveresize(self, x_root, y_root, direction, button, source_indicati
#use window coordinates (which include decorations)
wx, wy = self.get_window().get_root_origin()
ww, wh = self.get_window().get_size()
self.moveresize_event = (x_root, y_root, direction, button, wx, wy, ww, wh)
self.moveresize_event = [x_root, y_root, direction, button, None, wx, wy, ww, wh]

def initiate_moveresize_X11(self, x_root, y_root, direction, button, source_indication):
statelog("initiate_moveresize_X11%s", (x_root, y_root, MOVERESIZE_DIRECTION_STRING.get(direction, direction), button, SOURCE_INDICATION_STRING.get(source_indication, source_indication)))
Expand Down

0 comments on commit dafe5c6

Please sign in to comment.