Lines Matching refs:pWMInfo
128 WMInfoPtr pWMInfo;
135 WMInfoPtr pWMInfo;
147 static WMMsgNodePtr PopMessage(WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo);
153 GetWindowName(WMInfoPtr pWMInfo, xcb_window_t iWin, char **ppWindowName);
159 UpdateName(WMInfoPtr pWMInfo, xcb_window_t iWindow);
166 winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg);
170 PreserveWin32Stack(WMInfoPtr pWMInfo, xcb_window_t iWindow, UINT direction);
177 winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle);
279 PopMessage(WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo)
360 Xutf8TextPropertyToString(WMInfoPtr pWMInfo, xcb_icccm_get_text_property_reply_t *xtp)
365 (xtp->encoding == pWMInfo->atmUtf8String)) { // UTF-8 ISO 10646
384 GetWindowName(WMInfoPtr pWMInfo, xcb_window_t iWin, char **ppWindowName)
386 xcb_connection_t *conn = pWMInfo->conn;
398 cookie = xcb_get_property(pWMInfo->conn, FALSE, iWin,
399 pWMInfo->atmNetWmName,
401 reply = xcb_get_property_reply(pWMInfo->conn, cookie, NULL);
422 pszWindowName = Xutf8TextPropertyToString(pWMInfo, &reply);
441 pszClientMachine = Xutf8TextPropertyToString(pWMInfo, &reply);
481 IsWmProtocolAvailable(WMInfoPtr pWMInfo, xcb_window_t iWindow, xcb_atom_t atmProtocol)
486 xcb_connection_t *conn = pWMInfo->conn;
488 cookie = xcb_icccm_get_wm_protocols(conn, iWindow, pWMInfo->ewmh.WM_PROTOCOLS);
527 getHwnd(WMInfoPtr pWMInfo, xcb_window_t iWindow)
533 cookie = xcb_get_property(pWMInfo->conn, FALSE, iWindow, pWMInfo->atmPrivMap,
535 reply = xcb_get_property_reply(pWMInfo->conn, cookie, NULL);
583 GetClassNames(WMInfoPtr pWMInfo, xcb_window_t iWindow, char **res_name,
591 cookie1 = xcb_icccm_get_wm_class(pWMInfo->conn, iWindow);
592 if (xcb_icccm_get_wm_class_reply(pWMInfo->conn, cookie1, &reply1,
603 cookie2 = xcb_icccm_get_wm_name(pWMInfo->conn, iWindow);
604 if (xcb_icccm_get_wm_name_reply(pWMInfo->conn, cookie2, &reply2, NULL)) {
618 UpdateName(WMInfoPtr pWMInfo, xcb_window_t iWindow)
622 hWnd = getHwnd(pWMInfo, iWindow);
627 if (!IsOverrideRedirect(pWMInfo->conn, iWindow)) {
631 GetWindowName(pWMInfo, iWindow, &pszWindowName);
656 UpdateIcon(WMInfoPtr pWMInfo, xcb_window_t iWindow)
661 hWnd = getHwnd(pWMInfo, iWindow);
666 if (!IsOverrideRedirect(pWMInfo->conn, iWindow)) {
671 GetClassNames(pWMInfo, iWindow, &res_name, &res_class, &window_name);
678 winUpdateIcon(hWnd, pWMInfo->conn, iWindow, hIconNew);
687 UpdateStyle(WMInfoPtr pWMInfo, xcb_window_t iWindow)
693 hWnd = getHwnd(pWMInfo, iWindow);
698 winApplyHints(pWMInfo, iWindow, hWnd, &zstyle);
727 UpdateState(WMInfoPtr pWMInfo, xcb_window_t iWindow)
733 hWnd = getHwnd(pWMInfo, iWindow);
746 PreserveWin32Stack(WMInfoPtr pWMInfo, xcb_window_t iWindow, UINT direction)
753 hWnd = getHwnd(pWMInfo, iWindow);
770 XRaiseWindow(pWMInfo->pDisplay, xWindow);
772 XLowerWindow(pWMInfo->pDisplay, xWindow);
789 WMInfoPtr pWMInfo = pProcArg->pWMInfo;
792 winInitMultiWindowWM(pWMInfo, pProcArg);
803 pNode = PopMessage(&pWMInfo->wmMsgQueue, pWMInfo);
830 xcb_configure_window(pWMInfo->conn, pNode->msg.iWindow,
835 PreserveWin32Stack(pWMInfo, pNode->msg.iWindow, GW_HWNDPREV);
843 xcb_configure_window(pWMInfo->conn, pNode->msg.iWindow,
850 xcb_change_property(pWMInfo->conn, XCB_PROP_MODE_REPLACE,
851 pNode->msg.iWindow, pWMInfo->atmPrivMap,
859 xcb_change_property(pWMInfo->conn, XCB_PROP_MODE_REPLACE,
860 pNode->msg.iWindow, pWMInfo->atmPrivMap,
864 UpdateName(pWMInfo, pNode->msg.iWindow);
865 UpdateIcon(pWMInfo, pNode->msg.iWindow);
866 UpdateStyle(pWMInfo, pNode->msg.iWindow);
884 xcb_unmap_window(pWMInfo->conn, pNode->msg.iWindow);
890 if (IsWmProtocolAvailable(pWMInfo,
892 pWMInfo->atmWmDelete))
893 SendXMessage(pWMInfo->conn,
895 pWMInfo->atmWmProtos, pWMInfo->atmWmDelete);
897 xcb_kill_client(pWMInfo->conn, pNode->msg.iWindow);
917 cookie = xcb_icccm_get_wm_hints(pWMInfo->conn, pNode->msg.iWindow);
918 if (xcb_icccm_get_wm_hints_reply(pWMInfo->conn, cookie, &hints,
925 xcb_set_input_focus(pWMInfo->conn, XCB_INPUT_FOCUS_POINTER_ROOT,
928 if (IsWmProtocolAvailable(pWMInfo,
930 pWMInfo->atmWmTakeFocus))
931 SendXMessage(pWMInfo->conn,
933 pWMInfo->atmWmProtos, pWMInfo->atmWmTakeFocus);
939 UpdateName(pWMInfo, pNode->msg.iWindow);
943 UpdateIcon(pWMInfo, pNode->msg.iWindow);
949 if (IsOverrideRedirect(pWMInfo->conn, pNode->msg.iWindow))
952 UpdateStyle(pWMInfo, pNode->msg.iWindow);
957 UpdateState(pWMInfo, pNode->msg.iWindow);
970 xcb_flush(pWMInfo->conn);
974 xcb_generic_event_t *event = xcb_poll_for_event(pWMInfo->conn);
988 int e = xcb_connection_has_error(pWMInfo->conn);
997 pthread_cond_destroy(&pWMInfo->wmMsgQueue.pcNotEmpty);
1000 pthread_mutex_destroy(&pWMInfo->wmMsgQueue.pmMutex);
1165 if (pProcArg->pWMInfo->fCompositeWM) {
1328 winSendMessageToWM(pProcArg->pWMInfo, &msg);
1345 winSendMessageToWM(pProcArg->pWMInfo, &msg);
1356 winSendMessageToWM(pProcArg->pWMInfo, &msg);
1372 winSendMessageToWM(pProcArg->pWMInfo, &msg);
1399 WMInfoPtr pWMInfo = malloc(sizeof(WMInfoRec));
1403 if (pArg == NULL || pWMInfo == NULL || pXMsgArg == NULL) {
1406 free(pWMInfo);
1413 ZeroMemory(pWMInfo, sizeof(WMInfoRec));
1417 *ppWMInfo = pWMInfo;
1418 pWMInfo->fCompositeWM = compositeWM;
1422 pArg->pWMInfo = pWMInfo;
1426 if (!InitQueue(&pWMInfo->wmMsgQueue)) {
1440 pXMsgArg->pWMInfo = pWMInfo;
1461 winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
1507 pWMInfo->conn = xcb_connect_to_display_with_auth_info(pszDisplay,
1509 if (xcb_connection_has_error(pWMInfo->conn)) {
1519 while (xcb_connection_has_error(pWMInfo->conn) && iRetries < WIN_CONNECT_RETRIES);
1522 if (xcb_connection_has_error(pWMInfo->conn)) {
1532 pWMInfo->atmWmProtos = intern_atom(pWMInfo->conn, "WM_PROTOCOLS");
1533 pWMInfo->atmWmDelete = intern_atom(pWMInfo->conn, "WM_DELETE_WINDOW");
1534 pWMInfo->atmWmTakeFocus = intern_atom(pWMInfo->conn, "WM_TAKE_FOCUS");
1535 pWMInfo->atmPrivMap = intern_atom(pWMInfo->conn, WINDOWSWM_NATIVE_HWND);
1536 pWMInfo->atmUtf8String = intern_atom(pWMInfo->conn, "UTF8_STRING");
1537 pWMInfo->atmNetWmName = intern_atom(pWMInfo->conn, "_NET_WM_NAME");
1538 pWMInfo->atmCurrentDesktop = intern_atom(pWMInfo->conn, "_NET_CURRENT_DESKTOP");
1539 pWMInfo->atmNumberDesktops = intern_atom(pWMInfo->conn, "_NET_NUMBER_OF_DESKTOPS");
1540 pWMInfo->atmDesktopNames = intern_atom(pWMInfo->conn, "__NET_DESKTOP_NAMES");
1545 atoms_cookie = xcb_ewmh_init_atoms(pWMInfo->conn, &pWMInfo->ewmh);
1546 if (xcb_ewmh_init_atoms_replies(&pWMInfo->ewmh, atoms_cookie, NULL)) {
1553 pWMInfo->ewmh.WM_PROTOCOLS,
1554 pWMInfo->ewmh._NET_SUPPORTED,
1555 pWMInfo->ewmh._NET_SUPPORTING_WM_CHECK,
1556 pWMInfo->ewmh._NET_CLOSE_WINDOW,
1557 pWMInfo->ewmh._NET_WM_WINDOW_TYPE,
1558 pWMInfo->ewmh._NET_WM_WINDOW_TYPE_DOCK,
1559 pWMInfo->ewmh._NET_WM_WINDOW_TYPE_SPLASH,
1560 pWMInfo->ewmh._NET_WM_STATE,
1561 pWMInfo->ewmh._NET_WM_STATE_HIDDEN,
1562 pWMInfo->ewmh._NET_WM_STATE_ABOVE,
1563 pWMInfo->ewmh._NET_WM_STATE_BELOW,
1564 pWMInfo->ewmh._NET_WM_STATE_SKIP_TASKBAR,
1567 xcb_ewmh_set_supported(&pWMInfo->ewmh, pProcArg->dwScreen,
1576 root_screen = xcb_aux_get_screen(pWMInfo->conn, pProcArg->dwScreen);
1588 xcb_change_property(pWMInfo->conn, XCB_PROP_MODE_REPLACE, root_window_id,
1589 pWMInfo->atmCurrentDesktop, XCB_ATOM_CARDINAL, 32,
1592 xcb_change_property(pWMInfo->conn, XCB_PROP_MODE_REPLACE, root_window_id,
1593 pWMInfo->atmNumberDesktops, XCB_ATOM_CARDINAL, 32,
1596 xcb_change_property(pWMInfo->conn, XCB_PROP_MODE_REPLACE, root_window_id,
1597 pWMInfo->atmDesktopNames, pWMInfo->atmUtf8String, 8,
1607 xcb_cursor_t cursor = xcb_generate_id(pWMInfo->conn);
1608 xcb_font_t font = xcb_generate_id(pWMInfo->conn);
1617 xcb_open_font(pWMInfo->conn, font, sizeof("cursor"), "cursor");
1619 xcb_create_glyph_cursor(pWMInfo->conn, cursor, font, *mask_font,
1623 xcb_change_window_attributes(pWMInfo->conn, root_window_id, mask, &value_list);
1625 xcb_free_cursor(pWMInfo->conn, cursor);
1626 xcb_close_font(pWMInfo->conn, font);
1635 winSendMessageToWM(void *pWMInfo, winWMMessagePtr pMsg)
1646 PushMessage(&((WMInfoPtr) pWMInfo)->wmMsgQueue, pNode);
1723 winApplyHints(WMInfoPtr pWMInfo, xcb_window_t iWindow, HWND hWnd, HWND * zstyle)
1726 xcb_connection_t *conn = pWMInfo->conn;
1816 xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_window_type(&pWMInfo->ewmh, iWindow);
1817 if (xcb_ewmh_get_wm_window_type_reply(&pWMInfo->ewmh, cookie, &type, NULL)) {
1819 if (type.atoms[i] == pWMInfo->ewmh._NET_WM_WINDOW_TYPE_DOCK) {
1823 else if ((type.atoms[i] == pWMInfo->ewmh._NET_WM_WINDOW_TYPE_SPLASH)
1869 GetClassNames(pWMInfo, iWindow, &res_name, &res_class, &window_name);