3,428 questions
Score of 0
0 answers
62 views
Drawing pixels in Linux
I'm using SDL for drawing pixels and derived items for my graphical interface project.
As per new demands I need to switch to different lib.
I would consider X11 or something like this.
Basically I ...
Score of 3
1 answer
97 views
Why does `xcb_lookup_color()` fail where `XLookupColor()` succeeds?
I tried this code to compare XLookupColor() to xcb_lookup_color():
#include <X11/Xlib.h>
#include <string.h>
#include <xcb/xcb.h>
#include <stdio.h>
int main(void)
{
const ...
Score of 5
0 answers
139 views
Accepting Drag'n Drop in Java Swing with native data with flavor "application/x-color"
I've encountered a rather interesting problem. I wanted to extend my color-palette-viewer with the functionality to drag the colors into other applications. For a text editor this is easy, a ...
Score of 2
0 answers
150 views
`XOpenIM` failing because of `XSetLocaleModifiers`?
I'm just trying to open an input method:
#include <stdio.h>
#include <X11/Xlib.h>
int main() {
Display *display = XOpenDisplay(nullptr);
XSetLocaleModifiers("");
...
Score of 0
2 answers
163 views
How to programmatically hide a window from screen capture/screen sharing on Ubuntu (X11/Wayland) for a desktop OTP app?
I'm building a real-time desktop OTP application on Ubuntu and need to ensure the OTP window is never captured during screen sharing (Chrome, Zoom, OBS, Discord, etc.), even when the user shares their ...
Score of 2
0 answers
104 views
How to programatically start a drag for an Electron app on X11
I've been trying to reimplement electron-click-drag-plugin for the needs of my Electron app. But I hit a hard wall when implementing it for X11. I've successfully sent the EWMH event, but it doesn't ...
Score of 1
1 answer
114 views
Cairo rendering to Xlib surface paints garbage in transparency?
I'm trying to render a basic image to a window with Cairo. I set up the window, then paint the image to it as I normally would:
#include <threads.h>
#include <time.h>
#include <X11/...
Score of 0
5 answers
223 views
Best way to store current date (day month and year)
I am trying to decide on the best way to store a date, particularly as I want to be able to extract the year, month or day as integer values and also easily compare it to another date.
a. Store date/...
Score of 0
3 answers
176 views
How do I properly implement scrolling?
The only thing I could find online about scrolling is that Xlib gives you scrolling events as regular XButtonEvents (since, you know, we obviously need to track both scroll button presses and releases)...
Score of 0
2 answers
115 views
How to stop Cairo/X11 from flickering when resizing?
I'm trying to make a GUI app with Cairo, but whenever I resize the main window specifically inward, the background colour flickers in for a frame. There's a similar question about this, How to avoid ...
Score of 4
1 answer
178 views
How do I correctly handle `XCB_RESIZE_REQUEST` events?
I'm trying to use libxcb and cairo to make a GUI application in X11. Cairo needs to be notified every time the window resizes, so I set a handler for XCB_RESIZE_REQUEST events. However, when I resize ...
Score of 0
1 answer
147 views
How to avoid X11 race condition when multithreading with PyAutoGUI?
I am using X11 display server. I have a Python script that uses PyAutoGUI to turn touches on the screen into mouse movement and controls. The packets which send the coordinate (and other) data of ...
Score of 3
1 answer
135 views
Conversion of a color from a char pointer to an integer for LibX
I am creating for a school project an isometric projection of a wireframe 3D model using an API for Libx called Minilibx.
The input char *color is in the format 0xffffff
the input char *hexa is the ...
Score of 0
2 answers
76 views
X11 prevent existing window from recieving events (specifically a mouse up event)
Let's say there already exists a window.
I want the user to be able to hold mouse down on the window, prevent the window from receiving the mouse up events, and the window should think that the mouse ...
Score of 1
1 answer
68 views
glxinfo visual ID with depth=32 and alphaSize=0
On my machine, I get the following output from glxinfo -v (only relevant items shown):
Visual ID: 22 depth=24 class=DirectColor, type=(none)
bufferSize=24 level=0 renderType=rgba doubleBuffer=1 ...