xcb

Get window title with XCB

眉间皱痕 提交于 2019-12-21 21:39:40
问题 I am trying to get information about the window in focus. It seems that I get a correct window id from xcb_get_input_focus_reply_t->focus : it stays the same for my Eclipse IDE (56623164) and is another for any other window in focus. However, the value length is always 0 for XCB_ATOM_WM_NAME . shortened code cookie = xcb_get_property(c, 0, fr->focus, XCB_ATOM_WM_NAME, XCB_ATOM_STRING, 0, 0); if ((reply = xcb_get_property_reply(c, cookie, NULL))) { int len = xcb_get_property_value_length(reply

No error on xcb_grab_key but event loop not catching (Global Hotkey)

女生的网名这么多〃 提交于 2019-12-19 10:15:33
问题 I am trying to set up a global hotkey on Linux. I had initially used x11 ( libX11.so ) however I had to do this from a thread. I tried it but the XPendingEvent and XNextEvent would eventually crash the app. So I switched to xcb ( libxcb.so.1 ). There is no errors, I even check with xcb_request_check however the event loop is not picking anything up. As soon as I start the loop, I get only one event which looks like this: { response_type: 0, pad0: 10, sequence: 2, pad: [620, 2162688, 0, 0, 0,

Qt vs XCB: How powerful is Qt to do low level tasks?

别等时光非礼了梦想. 提交于 2019-12-13 20:07:34
问题 I'm trying to create a program to lock the screen of a computer with Linux OS which is to be unlocked using my own authentication mechanism. Can I do it in Qt alone( The lock screen, the ability to switch to the lock screen ...) or do I need to learn XCB or something related? 回答1: Window or session management like locking the screen isn't covered by Qt. You'll need to use native API. Usually locking the screen isn't something random applications do, but something the desktop environment

Going from Qt4 to Qt5 on Linux: This application failed to start because it could not find or load the Qt platform plugin “xcb”

偶尔善良 提交于 2019-12-13 18:17:41
问题 I'm moving from Qt4 (4.8.6) to Qt5 (5.4.1) in cross-build environment (GAR environment, MiniMyth2 project). I have perfectly building and running Qt4. I already successful cross-compiled and install Qt5. For reference - here is configure output: Configure summary Building on: linux-g++-64-garbuild (x86_64, CPU features: mmx sse sse2) Building for: linux-g++-64-garhost (x86_64, CPU features: mmx sse sse2) qmake vars .......... styles += mac fusion windows DEFINES += QT_NO_MTDEV CONFIG += use

reply_t vs request_t - passing them in interchangeably?

独自空忆成欢 提交于 2019-12-13 07:06:29
问题 I'm having an issue with XCB. I don't understand the difference between *_reply_t vs *_request_t types. It seems that the *_reply_t is passed in place of the *_response_t , however the structures are very different. For instance: xcb_randr_get_screen_resources_current_reply_t *reply = xcb_randr_get_screen_resources_current_reply( connection, xcb_randr_get_screen_resources_current(connection, root), NULL); So now reply is the type of *_reply_t . But now I need to use xcb_randr_get_screen

XEventsQueued equivalent in xcb

主宰稳场 提交于 2019-12-12 10:14:55
问题 I have read 'Need for XEventsQueued(display, QueuedAfterReading) in XCB' but the answer specifies a function ( xcb_poll_for_queued_event ) that modifies the internal event queue. I need a function that is exactly the equivalent of XEventsQueued(display, QueuedAfterReading) . Modifying the event queue breaks the code I'm currently writing if done where XEventsQueued would be used. What is the equivalent function or block of code in xcb? 来源: https://stackoverflow.com/questions/31624732

XCB Custom Message to Event Loop

ε祈祈猫儿з 提交于 2019-12-12 04:13:20
问题 I'm trying to send message to server, so it sends just back to my app's event loop. On my main thread I have this event loop: const int MY_CUST_MSG(877); xcb_generic_event_t *event; while (event = xcb_wait_for_event(connection)) { switch (event->response_type & ~0x80) { case MY_CUST_MSG: // do something break; default: // Unknown event type, ignore it debug_log("Unknown event: ", event->response_type); } free(event); } In another thread I want to send trigger the event loop on the main thread

Global alt+space hotkey grabbing - weird keyboard focus behaviour

孤者浪人 提交于 2019-12-10 17:25:37
问题 I'm grabbing Alt+Space global hotkey using xcb_grab_key , as follows: xcb_key_symbols_t *keysyms = xcb_key_symbols_alloc(c); xcb_keycode_t *keycodes = xcb_key_symbols_get_keycode(keysyms, XK_space), keycode; // add bindings for all screens xcb_screen_iterator_t iter; iter = xcb_setup_roots_iterator (xcb_get_setup (c)); for (; iter.rem; xcb_screen_next (&iter)) { int i = 0; while(keycodes[i] != XCB_NO_SYMBOL) { keycode = keycodes[i]; xcb_grab_key(c, true, iter.data->root, XCB_MOD_MASK_ANY,

Qt Threading Issues in Linux

北城以北 提交于 2019-12-10 12:37:14
问题 I have been developing with Qt for some time now on my project, and we are starting to move to a more thread-oriented design. Upon moving some GL rendering widgets to other threads I have discovered some very weird behavior. It appears that if a GL Widget begins updating from another thread (boost thread or QThread) before a widget that accepts user input (such as a QTextEdit) grabs focus, I get XCB crashes that look like: [xcb] Too much data requested from _XRead [xcb] This is most likely

How to handle window events while waiting for terminal input?

十年热恋 提交于 2019-12-08 05:01:23
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I've got a cross-platform (windows and unix+xcb) terminal+graphics_window application and it mostly works ok, until you wait too long at the input prompt, where under heavy load the image may disappear. :( I've got a mainloop (REPL) for the interpreter (postscript interpreter) which calls an event handler function each time around its loop. The event handler