def get_paint_context(self, gdk_window): hwnd = get_window_handle(gdk_window) if self.hwnd != hwnd: #(this shouldn't happen) #just make sure we don't keep using a context for a different handle: self.destroy() if not self.context: self.context = self.create_wgl_context(hwnd) return WGLWindowContext(hwnd, self.hdc, self.context)
def fixup_window_style(window): from xpra.platform.win32.gui import get_window_handle from xpra.platform.win32.common import GetWindowLongW, SetWindowLongW from xpra.platform.win32 import win32con hwnd = get_window_handle(window) cur_style = GetWindowLongW(hwnd, win32con.GWL_STYLE) #re-add taskbar menu: style = cur_style if cur_style & win32con.WS_CAPTION: style |= win32con.WS_SYSMENU style |= win32con.WS_MAXIMIZEBOX style |= win32con.WS_MINIMIZEBOX if False: #not resizable style &= ~win32con.WS_MAXIMIZEBOX style &= ~win32con.WS_SIZEBOX if style != cur_style: print("fixup_window_style() from %#x to %#x" % (cur_style, style)) SetWindowLongW(hwnd, win32con.GWL_STYLE, style)