From 1d45cbd1306a650dd031e05bf8a6e0a51a61a911 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 2 Nov 2015 06:58:38 +0000 Subject: [PATCH] #980: cosmetic changes: * typo * log WM_WININICHANGE string * don't log any custom sys atoms at warn level, only info level * ignore WM_SYSCOLORCHANGE git-svn-id: https://xpra.org/svn/Xpra/trunk@11106 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/platform/win32/gui.py | 10 +++++++++- src/xpra/platform/win32/win32_events.py | 7 ++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/xpra/platform/win32/gui.py b/src/xpra/platform/win32/gui.py index 0360d2d9f4..a87284d743 100644 --- a/src/xpra/platform/win32/gui.py +++ b/src/xpra/platform/win32/gui.py @@ -82,7 +82,7 @@ def do_init(): screenlog("SetProcessDPIAwareness(%s)=%s", DPI_AWARENESS, dpi_set) except Exception as e: screenlog("SetProcessDPIAwareness(%s) failed: %s", DPI_AWARENESS, e) - screenlog(" (not available on MS Windows before version 8") + screenlog(" (not available on MS Windows before version 8)") def get_native_notifier_classes(): @@ -611,6 +611,7 @@ def __init__(self, client, opts): el.add_event_callback(win32con.WM_MOVE, self.wm_move) el.add_event_callback(WM_WTSSESSION_CHANGE, self.session_change_event) el.add_event_callback(win32con.WM_INPUTLANGCHANGE, self.inputlangchange) + el.add_event_callback(win32con.WM_WININICHANGE, self.inichange) except Exception as e: log.error("cannot register focus and power callbacks: %s", e) @@ -645,6 +646,13 @@ def session_change_event(self, event, session): def inputlangchange(self, wParam, lParam): log("WM_INPUTLANGCHANGE: %i, %i", wParam, lParam) + def inichange(self, wParam, lParam): + if lParam: + from ctypes import c_char_p + log("WM_WININICHANGE: %#x=%s", lParam, c_char_p(lParam).value) + else: + log("WM_WININICHANGE: %i, %i", wParam, lParam) + def activateapp(self, wParam, lParam): c = self.client diff --git a/src/xpra/platform/win32/win32_events.py b/src/xpra/platform/win32/win32_events.py index af7380e3b8..20bd82c333 100755 --- a/src/xpra/platform/win32/win32_events.py +++ b/src/xpra/platform/win32/win32_events.py @@ -25,11 +25,10 @@ win32con.WM_WININICHANGE : "WM_WININICHANGE", #happens after resume too? win32con.WM_WINDOWPOSCHANGING : "WM_WINDOWPOSCHANGING", win32con.WM_GETMINMAXINFO : "WM_GETMINMAXINFO", + win32con.WM_SYSCOLORCHANGE : "WM_SYSCOLORCHANGE", WM_WTSSESSION_CHANGE : "WM_WTSSESSION_CHANGE", WM_DWMNCRENDERINGCHANGED : "WM_DWMNCRENDERINGCHANGED", 800 : "screen background changed", #I can't find this definition anywhere - 0xc1b8 : "something screen related", #no idea where this is defined, happens when we add or remove screens? - 0xc0aa : "something screen related", #no idea where this is defined, happens when we add or remove screens? } LOG_EVENTS = { win32con.WM_POWERBROADCAST : "WM_POWERBROADCAST: power management event", @@ -161,6 +160,7 @@ def MyWndProc(self, hWnd, msg, wParam, lParam): #elif msg==win32con.WM_ACTIVATEAPP: # log("WM_ACTIVATEAPP focus changed: %s / %s", wParam, lParam) else: + l = log.warn if (msg>=0 and msg<=win32con.WM_USER) or msg>0xFFFF: ut = "reserved system" elif msg>=win32con.WM_USER and msg<=0x7FFF: @@ -169,9 +169,10 @@ def MyWndProc(self, hWnd, msg, wParam, lParam): ut = "WM_APP" elif msg>=0xC000 and msg<=0xFFFF: ut = "string" + l = log.info else: ut = "/ unexpected" - log.warn("unknown %s message: %s / %s / %s", ut, event_name, wParam, lParam) + l("unknown %s message: %s / %s / %s", ut, event_name, wParam, lParam) else: log.warn("invalid hwnd: %s (expected %s)", hWnd, self.hwnd) # Pass all messages to the original WndProc