Skip to content

Commit

Permalink
#770 / #1293 / #911 / #469: remove workarounds and enable reparent to…
Browse files Browse the repository at this point in the history
… root

git-svn-id: https://xpra.org/svn/Xpra/trunk@13690 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 13, 2016
1 parent 38d1232 commit 3a9698e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
15 changes: 3 additions & 12 deletions src/xpra/client/client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,20 +620,12 @@ def dbus_call(self, *args, **kwargs):
return self._client.rpc_call("dbus", rpc_args, **kwargs)


def get_mouse_event_wid(self):
#on OSX, the mouse events are reported against the wrong window by GTK,
#so we have to use the currently focused window
if sys.platform.startswith("darwin"):
return self._client._focused or self._id
return self._id

def do_motion_notify_event(self, event):
if self._client.readonly:
return
pointer, modifiers, buttons = self._pointer_modifiers(event)
wid = self.get_mouse_event_wid()
mouselog("do_motion_notify_event(%s) wid=%s / focus=%s, device=%s, pointer=%s, modifiers=%s, buttons=%s", event, self._id, self._client._focused, self._device_info(event), pointer, modifiers, buttons)
self._client.send_mouse_position(["pointer-position", wid,
self._client.send_mouse_position(["pointer-position", self._id,
pointer, modifiers, buttons])

def _device_info(self, event):
Expand All @@ -646,13 +638,12 @@ def _button_action(self, button, event, depressed):
if self._client.readonly:
return
pointer, modifiers, buttons = self._pointer_modifiers(event)
wid = self.get_mouse_event_wid()
mouselog("_button_action(%s, %s, %s) wid=%s / focus=%s, device=%s, pointer=%s, modifiers=%s, buttons=%s", button, event, depressed, self._id, self._client._focused, self._device_info(event), pointer, modifiers, buttons)
def send_button(pressed):
self._client.send_button(wid, button, pressed, pointer, modifiers, buttons)
self._client.send_button(self._id, button, pressed, pointer, modifiers, buttons)
pressed_state = self.button_state.get(button, False)
if SIMULATE_MOUSE_DOWN and pressed_state is False and depressed is False:
mouselog("button action: simulating a missing mouse-down event for window %s before sending the mouse-up event", wid)
mouselog("button action: simulating a missing mouse-down event for window %s before sending the mouse-up event", self._id)
#(needed for some dialogs on win32):
send_button(True)
self.button_state[button] = depressed
Expand Down
3 changes: 2 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 @@ -1077,7 +1077,8 @@ def send_configure_event(self, skip_geometry=False):
cy = self._client.cy
packet = ["configure-window", self._id, cx(x), cy(y), cx(w), cy(h), props, self._resize_counter, state, skip_geometry]
if self._client.window_configure_pointer:
packet.append(self.get_mouse_event_wid())
#window id is redundant (now that we removed an OSX focus workaround)
packet.append(self._id)
packet.append(self._client.get_mouse_position())
packet.append(self._client.get_current_modifiers())
geomlog("%s", packet)
Expand Down
6 changes: 3 additions & 3 deletions src/xpra/x11/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
eventlog = Logger("x11", "events")

import xpra
from xpra.util import nonl, typedict
from xpra.util import nonl, typedict, envint
from xpra.x11.x11_server_base import X11ServerBase, mouselog

REPARENT_ROOT = os.environ.get("XPRA_REPARENT_ROOT", "0")=="1"
SCALED_FONT_ANTIALIAS = os.environ.get("XPRA_SCALED_FONT_ANTIALIAS", "0")=="1"
REPARENT_ROOT = envint("XPRA_REPARENT_ROOT", 1)
SCALED_FONT_ANTIALIAS = envint("XPRA_SCALED_FONT_ANTIALIAS")


class DesktopManager(gtk.Widget):
Expand Down

0 comments on commit 3a9698e

Please sign in to comment.