Skip to content

Commit

Permalink
avoid warnings with win32 shadow servers: ignore more events
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@12707 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 29, 2016
1 parent 7512488 commit 035f9b6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
16 changes: 15 additions & 1 deletion src/xpra/platform/win32/shadow_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from xpra.platform.win32.keyboard_config import KeyboardConfig, fake_key
from xpra.platform.win32.gui import get_virtualscreenmetrics
from xpra.platform.win32.namedpipes.connection import NamedPipeConnection
from xpra.platform.win32.win32_events import get_win32_event_listener
from xpra.codecs.image_wrapper import ImageWrapper

NOEVENT = object()
Expand Down Expand Up @@ -230,6 +231,18 @@ class ShadowServer(GTKShadowServerBase):
def __init__(self):
GTKShadowServerBase.__init__(self)
self.keycodes = {}
el = get_win32_event_listener()
#TODO: deal with those messages?
#el.add_event_callback(win32con.WM_POWERBROADCAST, self.power_broadcast_event)
#el.add_event_callback(WM_WTSSESSION_CHANGE, self.session_change_event)
#these are bound to callbacks in the client,
#but on the server we just ignore them:
el.ignore_events.update({
win32con.WM_ACTIVATEAPP : "WM_ACTIVATEAPP",
win32con.WM_MOVE : "WM_MOVE",
win32con.WM_INPUTLANGCHANGE : "WM_INPUTLANGCHANGE",
win32con.WM_WININICHANGE : "WM_WININICHANGE",
})


def add_listen_socket(self, socktype, sock):
Expand Down Expand Up @@ -306,7 +319,8 @@ def get_info(self, proto):
info.setdefault("server", {
"type" : "Python/gtk2/win32-shadow",
"tray" : self.tray,
"tray-icon" :self.tray_icon or ""})
"tray-icon" : self.tray_icon or ""
})
return info


Expand Down
12 changes: 6 additions & 6 deletions src/xpra/platform/win32/win32_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def __init__(self):
100, 100, 900, 900, 0, 0, 0, None)
self.old_win32_proc = None
self.event_callbacks = {}
self.ignore_events = IGNORE_EVENTS
self.log_events = LOG_EVENTS
self.detect_win32_session_events()
log("Win32EventListener create with hwnd=%s", self.hwnd)

Expand Down Expand Up @@ -159,12 +161,10 @@ def MyWndProc(self, hWnd, msg, wParam, lParam):
c(wParam, lParam)
except:
log.error("error in callback %s", c, exc_info=True)
elif msg in IGNORE_EVENTS:
log("%s: %s / %s", IGNORE_EVENTS.get(msg), wParam, lParam)
elif msg in LOG_EVENTS:
log.info("%s: %s / %s", LOG_EVENTS.get(msg), wParam, lParam)
#elif msg==win32con.WM_ACTIVATEAPP:
# log("WM_ACTIVATEAPP focus changed: %s / %s", wParam, lParam)
elif msg in self.ignore_events:
log("%s: %s / %s", self.ignore_events.get(msg), wParam, lParam)
elif msg in self.log_events:
log.info("%s: %s / %s", self.log_events.get(msg), wParam, lParam)
else:
l = log.warn
if (msg>=0 and msg<=win32con.WM_USER) or msg>0xFFFF:
Expand Down

0 comments on commit 035f9b6

Please sign in to comment.