Ticket #1570: win32-opengl-alpha.patch
File win32-opengl-alpha.patch, 2.6 KB (added by , 5 years ago) |
---|
-
xpra/platform/win32/common.py
257 257 258 258 IID = GUID 259 259 REFIID = POINTER(IID) 260 261 262 HGRN = HANDLE 263 class DWM_BLURBEHIND(Structure): 264 _fields_ = [ 265 ("dwFlags", DWORD), 266 ("fEnable", BOOL), 267 ("hRgnBlur", HGRN), 268 ("fTransitionOnMaximized", BOOL), 269 ] 270 CreateRectRgn = gdi32.CreateRectRgn 271 CreateRectRgn.restype = HGRN 272 CreateRectRgn.argtypes = [INT, INT, INT, INT] 273 274 DWM_BB_ENABLE = 1 275 DWM_BB_BLURREGION = 2 276 DWM_BB_TRANSITIONONMAXIMIZED = 4 277 278 dwmapi = WinDLL("dwmapi", use_last_error=True) 279 DwmEnableBlurBehindWindow = dwmapi.DwmEnableBlurBehindWindow 280 DwmEnableBlurBehindWindow.restype = HRESULT 281 DwmEnableBlurBehindWindow.argtypes = [HWND, POINTER(DWM_BLURBEHIND)] -
xpra/client/gl/gtk3/gl_client_window.py
9 9 10 10 from xpra.client.gtk3.client_window import ClientWindow 11 11 from xpra.client.gl.gtk_base.gl_client_window_common import GLClientWindowCommon 12 from xpra.platform.win32.gui import get_window_handle 12 13 13 14 14 15 class GLClientWindowBase(GLClientWindowCommon, ClientWindow): … … 17 18 ClientWindow.set_alpha(self) 18 19 rgb_formats = self._client_properties.get("encodings.rgb_formats", []) 19 20 GLClientWindowCommon.add_rgb_formats(self, rgb_formats) 21 log.info("set_alpha() has_alpha=%s", self._has_alpha) 22 if self._has_alpha: 23 self.when_realized("alpha", self._enable_gl_alpha) 24 self.timeout_add(1000, self._enable_gl_alpha) 20 25 26 def _enable_gl_alpha(self): 27 log.info("_enable_gl_alpha() window=%s", self.get_window()) 28 from xpra.platform.win32.common import CreateRectRgn, DWM_BLURBEHIND, DWM_BB_ENABLE, DWM_BB_BLURREGION, DwmEnableBlurBehindWindow 29 from ctypes import byref 30 rgn = CreateRectRgn(0, 0, 1000, 1000) 31 log.info("CreateRectRgn(..)=%#x", rgn) 32 bb = DWM_BLURBEHIND() 33 bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION 34 bb.hRgnBlur = rgn 35 bb.fEnable = True 36 hwnd = get_window_handle(self) 37 log.info("hwnd=%x", hwnd) 38 r = DwmEnableBlurBehindWindow(hwnd, byref(bb)) 39 log.info("r=%s", r) 40 21 41 def do_configure_event(self, event): 22 42 log("GL do_configure_event(%s)", event) 23 43 ClientWindow.do_configure_event(self, event)