Skip to content

Commit

Permalink
#976: add key shortcut to reset scaling, new shortcuts using numpad
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@10653 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 16, 2015
1 parent 88373c7 commit 985ec7b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/etc/xpra/xpra.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ key-shortcut = Meta+Shift+F11:show_session_info
key-shortcut = Meta+Shift+plus:scaleup
key-shortcut = Meta+Shift+minus:scaledown
key-shortcut = Meta+Shift+underscore:scaledown
key-shortcut = Meta+Shift+KP_Add:scaleup
key-shortcut = Meta+Shift+KP_Subtract:scaledown
key-shortcut = Meta+Shift+KP_Multiply:scalereset

# Border:
#border=5,auto
Expand Down
3 changes: 3 additions & 0 deletions src/xpra/client/client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ def scaleup(self, *args):
def scaledown(self, *args):
self._client.scaledown()

def scalereset(self, *args):
self._client.scalereset()

def magic_key(self, *args):
log.info("magic_key(%s) not handled in %s", args, type(self))

Expand Down
4 changes: 3 additions & 1 deletion src/xpra/client/gtk_base/gtk_client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,9 @@ def do_set_shape():
rectangles = [srect(*x) for x in rectangles]
#FIXME: are we supposed to get the offset from the "extents"?
x_off, y_off = 0, 0
shapelog("XShapeCombineRectangles %s=%s", name, rectangles)
shapelog("XShapeCombineRectangles %s=%i rectangles", name, len(rectangles))
#too expensive to log:
#shapelog("XShapeCombineRectangles %s=%s", name, rectangles)
with xsync:
X11Window.XShapeCombineRectangles(xid, kind, x_off, y_off, rectangles)
self.when_realized("shape", do_set_shape)
Expand Down
3 changes: 3 additions & 0 deletions src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,9 @@ def scaleup(self):
def scaledown(self):
self.scale_change(0.5, 0.5)

def scalereset(self):
self.scale_change(1.0/self.xscale, 1.0/self.yscale)

def scale_change(self, xchange=1, ychange=1):
if self.server_is_shadow and self.shadow_fullscreen:
scalinglog("scale_change(%s, %s) ignored, fullscreen shadow mode is active", xchange, ychange)
Expand Down
4 changes: 3 additions & 1 deletion src/xpra/scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ def get_defaults():
"Meta+Shift+F11:show_session_info",
"Meta+Shift+plus:scaleup",
"Meta+Shift+minus:scaledown",
"Meta+Shift+underscore:scaledown",
"Meta+Shift+KP_Add:scaleup",
"Meta+Shift+KP_Subtract:scaledown",
"Meta+Shift+KP_Multiply:scalereset",
],
"bind-tcp" : [],
"start" : [],
Expand Down

0 comments on commit 985ec7b

Please sign in to comment.