x11

Using Python GTK GUI front end with C++ backend

依然范特西╮ 提交于 2021-02-09 06:57:28
问题 I have some C++ code and am now building a GUI for an application. In the past I've used python and pygtk for GUI programming and occasionally link to some C++ code to do some heavy lifting. I would like to continue that trend but have one question on how to do it in this case. Part of the C++ code gets images from a camera and I would like to display those images on the GUI. I've used libvlc in the past and could pass the xid from a DrawingArea to vlc to draw the video on. I would like to do

Detect if compositor is running

爷,独闯天下 提交于 2021-02-07 04:20:44
问题 I want my UI to change design depending on whether the screen is composited (thus supporting certain effects) or not. Is it possible to Reliably query whether the X server is running a compositing window manager Get notified when compositing is switched on/off? Solution: To elaborate on Andrey Sidorov's correct answer for people not so familiar with the X11 API, this is the code for detecting a EWMH-compliant compositor: int has_compositor(Display *dpy, int screen) { char prop_name[20];

Detect if compositor is running

会有一股神秘感。 提交于 2021-02-07 04:19:22
问题 I want my UI to change design depending on whether the screen is composited (thus supporting certain effects) or not. Is it possible to Reliably query whether the X server is running a compositing window manager Get notified when compositing is switched on/off? Solution: To elaborate on Andrey Sidorov's correct answer for people not so familiar with the X11 API, this is the code for detecting a EWMH-compliant compositor: int has_compositor(Display *dpy, int screen) { char prop_name[20];

Convert from Xlib to xcb

◇◆丶佛笑我妖孽 提交于 2021-02-06 12:43:11
问题 I am currently porting one of my applications from Xlib to libxcb and I am having a bit trouble finding informations on the XInput2 extension I use at some point. Is there an XInput2 implementation in libxcb? If yes, where can I find the documentation. Currently I am having trouble for example with this functions: XIQueryDevice , XISelectEvents . These are mainly the functions I use. Maybe someone can point out the documentation for me or provide me a very small example to get started. 回答1:

Fake X server for testing?

和自甴很熟 提交于 2021-02-06 10:03:26
问题 At work we fully test the GUI components. The problem arises from the fact that, while the testsuite is running, the various components pop up, stealing the focus or making it impossible to continue working. The first thing I thought of was Xnest, but I was wondering if there's a more elegant solution to this problem. 回答1: I think what you need to do here is have your tests run on a different Display than the one you're working on. When we moved our TeamCity agents to EC2, we had to figure

What event is used for Maximizing/Minimizing?

时间秒杀一切 提交于 2021-02-04 15:51:46
问题 Currently I am in charge of developing a (C++) window class for a little project; the goal is to keep dependencies at a bare minimum. The implementation for Win32/WinAPI works as supposed, however, I am struggling when it comes to Linux/XCB. I am aware, that I am able to check the "_NET_WM_STATE" property, however, the documentation doesn't specify any event, which would occur when the window is being maximized or minimized. The Extended Window Manager Hints specification doesn't seem to

Handle C-q with XLookupString

谁说胖子不能爱 提交于 2021-01-29 07:55:41
问题 This is a working example of X11 code that handles Ctrl-q event to quit application: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> void exitOnCondition(char cond, const char *msg, int exitCode, Display *dpy, Window *w, GC *gc) { if(cond) { printf("%s\n", msg); if(dpy && gc) XFreeGC(dpy, *gc); if(dpy && w) XDestroyWindow(dpy, *w); if(dpy) XCloseDisplay(dpy); exit(exitCode); } } int main(int argc, char **argv) {

fatal error 'GL/glx.h' file not found on mac after Xquartz is installed

£可爱£侵袭症+ 提交于 2021-01-29 03:45:27
问题 When i run the program i get the following error fatal error: 'Gl/glx.h' file not found I am attempting to run a c++ xll graphics program on my mac. I have already downloaded Xquartz and used it to run multiple graphics programs on my computer and now i am trying to figure out what i'm missing in order to get this program to run. if anybody can point me in the right direction it would be wonderful! Thanks here is a copy of the make file provided 1 ## If you receive XRR errors, include

fatal error 'GL/glx.h' file not found on mac after Xquartz is installed

岁酱吖の 提交于 2021-01-29 03:42:45
问题 When i run the program i get the following error fatal error: 'Gl/glx.h' file not found I am attempting to run a c++ xll graphics program on my mac. I have already downloaded Xquartz and used it to run multiple graphics programs on my computer and now i am trying to figure out what i'm missing in order to get this program to run. if anybody can point me in the right direction it would be wonderful! Thanks here is a copy of the make file provided 1 ## If you receive XRR errors, include

FLTK 1.4 widget position w.r.t. X11 root window?

喜你入骨 提交于 2021-01-28 01:52:00
问题 context I am coding with others RefPerSys, a GPLv3+ project in C++17 on gitlab for GNU/Linux/x86-64/Debian/Sid. Its fltk-branch git branch is using FLTK 1.4, compiled from source code, with an Xorg display server. I have C++ classes like (in file headfltk_rps.hh): class RpsGui_Window: public Fl_Double_Window { static std::set<RpsGui_Window*> _set_of_gui_windows_; public: virtual int handle(int); protected: Fl_Menu_Bar *guiwin_menubar; std::string guiwin_label; virtual void initialize_menubar