Skip to content

Commit

Permalink
#980: cosmetic changes:
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
totaam committed Nov 2, 2015
1 parent aa2dcf0 commit 1d45cbd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/xpra/platform/win32/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/xpra/platform/win32/win32_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 1d45cbd

Please sign in to comment.