xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #2956: gui.py.patch

File gui.py.patch, 1.2 KB (added by brief, 5 months ago)
  • src/xpra/platform/win32/gui.py

     
    1111import types
    1212import ctypes
    1313from ctypes import WinDLL, CFUNCTYPE, c_int, POINTER, Structure, byref, sizeof
    14 from ctypes.wintypes import HWND, DWORD, WPARAM, LPARAM, MSG, POINT, RECT
     14from ctypes.wintypes import HWND, DWORD, WPARAM, LPARAM, MSG, POINT, RECT, HGDIOBJ
    1515from ctypes import CDLL, pythonapi, c_void_p, py_object
    1616from ctypes.util import find_library
    1717
     
    5555
    5656
    5757PyCapsule_GetPointer = pythonapi.PyCapsule_GetPointer
    58 PyCapsule_GetPointer.restype = c_void_p
     58PyCapsule_GetPointer.restype = HGDIOBJ
    5959PyCapsule_GetPointer.argtypes = [py_object]
    6060log("PyCapsute_GetPointer=%s", PyCapsule_GetPointer)
    6161gdkdll = CDLL(find_library("libgdk-3-0.dll"))
     
    254254    if not gdk_window:
    255255        return 0
    256256    gpointer =  PyCapsule_GetPointer(gdk_window.__gpointer__, None)
     257    gdkdll.gdk_win32_window_get_handle.argtypes = [HGDIOBJ]
    257258    hwnd = gdkdll.gdk_win32_window_get_handle(gpointer)
    258259    #log("get_window_handle(%s) gpointer=%#x, hwnd=%#x", gpointer, hwnd)
    259260    return hwnd