FAQ Database Discussion Community


Emacs 25 yank from x windows PRIMARY clipboard buffer with keyboard

emacs,x11,xorg
Using Emacs 25 in a linux environment, I often copy text with the mouse and wish that I could paste the copied text with some command in Emacs, but currently the only way I know of is via the mouse middle click which is bound to mouse-yank-primary. I've attempted to...

linux x11 window manager - blocking mouse events

linux,x11,xlib,window-managers
Let's assume that a few windows are visible - I need to implement mechanism which will block events for a selected windows, for example when user click a button in window_nr1 and window_nr2 nothing happens but when a user click a button in window_nr3 event is processed. Compositing window manager...

How to restore a window with Xlib?

linux,unix,x11,gnome,xlib
I've managed to iconify a window using XIconifyWindow, but haven't managed to later restore it. I tried the following: XMapRaised (display, window); And: XMapWindow (display, window); And: XClientMessageEvent ev; std::memset (&ev, 0, sizeof ev); ev.type = ClientMessage; ev.window = window; ev.message_type = XInternAtom(display, "WM_CHANGE_STATE", False); ev.format = 32; ev.data.l[0] =...

Xkb configuration for emacs

emacs,keyboard,x11
I'm trying to remap three keys, left alt, right win and menu, to specific keys for emacs. Specifically, I wants to use RWIN as Hyper, my left alt as Meta and My MENU as Alt. I setup xkb in this way. there are two files, the first one is super_hyper...

Patch scrolling back in suckless ST terminal to support mouse wheel

c,unix,terminal,x11
The ST terminal has a patch for scrolling back. I want to update said patch to enable mouse wheel up and down signals in additions to "PageUp" and "PageDown". I suspect that a small change in config.h is what is needed but I have no experience in terminal code thus...

Restarting a freeglut / OpenGL C application fails on Ubuntu when using special cursors

linux,opengl,ubuntu,x11,freeglut
I have a freeglut application that can be closed and reopened on user demand. It works fine on Windows and Ubuntu, unless I specify the Mouse cursor look. Here's a minimum working example: #include <stdio.h> #include <unistd.h> #include <GL/freeglut.h> void keyboard(unsigned char key, const int x, const int y); void...

xlib, remove delay when holding down a key

x11,xlib
I've just created a simple demo in opengl that involves movement and rotation of the camera. The problem is in the controls. There is a delay between the first time and second time that the keypress is registered when I am holding down the key. After that there is no...

Is it possible to set window transparency in codelite, for example for the output or workspace view? [solved]

linux,window,transparency,x11,codelite
Is there a fast option to hardcode this since this feature seems to e missing and how platform dependent would that be? I use xubuntu.

libX11: XPutImage first call

c,x11
I've created XImage using XCreateImage and use XPutImage to display it on window, but XPutImage shows this picture only on second call of it. Why this happens? #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <X11/Xlib.h> #include <X11/Xutil.h> void draw(char *rgb_out, int w, int h) { int i = 0; for...

When I use hsqldb I have problems with GUI (JavaFx)

java,javafx,x11,hsqldb
I can't understand how RDB can be linked with GUI but I've checked several times. I have osgi javafx application. when I install hsqldb and use database I have strange problems: Before that I used h2 and I didn't have anything like that. And the only thing was changed is...

How to get XRender man pages on Ubuntu?

ubuntu,x11,man
$ man XRenderFillRectangle No manual entry for XRenderFillRectangle I already have thees packages installed: xorg-docs-core libx11-doc libx11-dev libxrender-dev...

Qt X11BypassWindowManagerHint open QFileDialog crash

qt,qt5,x11,cinnamon
I have a QMainWindow with windows flag set to be X11BypassWindowManagerHint. There is a QPushButton in the window triggering a QFileDialog. When the event is triggered, cinnamon will crash. When the flag is removed, there will be no crash. Please note that the window is required to always stay on...

How to subpixel render glyphs with XRender extension

x11,freetype,subpixel
I found this great example of text rendering using XRender extension. But the font is loaded from Freetype in grayscale format, is there a way to ustilize XRender to draw subpixel (LCD) antialiased glyphs? If yes, how?

Xlib fails (Segmentation fault) even with each connection per thread

multithreading,x11,xlib
So far as I know about X11 with Xlib, is that with multi threading a programmer has 2 choices call early enough XInitThreads or use new connection (XOpenDisplay) per thread. Suppose i don't like first the first method with XInitThreads() call. Why does second fail? #include <X11/Xlib.h> #include <thread> void...

OCaml Graphics.open_graph “Cannot open display …”

emacs,graphics,ocaml,x11
The last line of this code #load "graphics.cma";; open Graphics;; open_graph " 600x400";; returns the following error: Graphics.Graphic_failure "Cannot open display My-Machine.local" Since I use Emacs 24.4 in tuareg mode, on OSX 10.9.5, I've installed XQuartz 2.7.7 and tried to tune it (looked here). I checked whether Graphics is properly...

loading ggplot2 (colorspace, actually) opens up x11

r,ggplot2,x11,color-space
Whenever I so much as load ggplot2, X11 jumps into action (hogging resources). library(ggplot2) Is what I do, and boom – X11 The thing is, I don't want to use X11, nor do I want it to be open – I want to use Quartz and the build-in graphics in...

Taking a screenshot of a window in C using only the X11 lib

c,linux,screenshot,x11
I am coding a raytracer engine in C using X11 on a Linux. I would like to add a screenshot feature but I can't use any other lib than the standard X11. Is there a "simple" way to do that, or do I have to create a bmp file myself...

What exactly is X11 Channel

x11
In all the documentations of X11 that I've found so far something like this is written Communication between server and clients is done by exchanging packets over a channel. The connection is established by the client (how the client is started is not specified in the protocol). (from wikipedia) I...

XCB – Not receiving motion notify events on all windows

c,google-chrome,x11,xcb
I am trying to be notified about any pointer motion. Since I don't want to run as the window manager, I need to set XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_POINTER_MOTION on all windows which I do both on startup and when I get a create notify event. This seems to work fine in...

Is it possible to install x11 without pulling in hundreds of other packages?

dependencies,x11,rpm,opensuse,xterm
I'm sure this is a stupid question, but I'm going to ask anyway. Is it possible to install the xterm and xorg-x11-fonts packages on an OpenSuSE machine without pulling in a ton of other packages that it seems to depend on? Is everything in that host of packages truly needed?...

Why is XKeysymToKeycode() making all of my keys lowercase?

c,x11,xlib
I'm currently having a problem with Xlib where whenever I call XKeysymToKeycode() and pass in an uppercase KeySym, it returns a lowercase KeyCode. Google doesn't really seem to have an answer to this question, or too much documentation at all on the functions I'm using, for that matter. Here's the...

How to run CUDA/OpenGL interop (particle) sample from a remote machine

ubuntu,cuda,x11,freeglut,nsight
I am trying to run the CUDA particle sample on a remote Ubuntu machine from a host ubuntu machine. I followed this tutorial: http://devblogs.nvidia.com/parallelforall/remote-application-development-nvidia-nsight-eclipse-edition/ and it runs on my host, but not on my remote machine. I get the following output in Nsight: CUDA Particles Simulation Starting... grid: 64 x...

How to stop an X11 event loop gracefully asynchronously

c,multithreading,x11
I have a small X11 application which has two threads. In one thread, I am listening to X11 events using XGrabKey() and then in a loop XNextEvent(). The other thread is doing other stuff and is not related to X11. Here's the code of the relevant thread: #include <X11/Xlib.h> #include...

Running Chromium inside Docker - Gtk: cannot open display: :0

docker,x11,chromium
When I try to run chromium inside a docker container I see the following error: Gtk: cannot open display: :0 Dockerfile: (based on https://registry.hub.docker.com/u/jess/chromium/dockerfile) FROM debian:jessie # Install Chromium RUN sed -i.bak 's/jessie main/jessie main contrib non-free/g' /etc/apt/sources.list && \ apt-get update && apt-get install -y \ chromium \ chromium-l10n...

WM_ACTIVATE and WM_SYSCOMMAND message equivalents for X11

c++,x11
I am currently porting a game engine from win32 to linux and was wondering about retrieving messages from the x window. As I stated in the topic I am searching for a way to intercept window messages that trigger screen saver/screen lock and minimized/maximized state, because I want to pause...

Make OpenGL context with No screens

c++,linux,opengl,debian,x11
I am trying to make a opengl context with glx on a debian server. The problem is that I can't make the display and it seems the reason is because there is no X server running and I cannot start an X server with sudo startx because it says there...

How to automatically append the txt contents of the X11 clipboard to the end of a Linux command line

shell,x11
:) I use Linux Mint. Each day I run a BASH script, that is appended with a new web link. The script looks like this: ./analyse http://www.the-daily-variable-web-link-goes-here.com Each day after I copy the link using a mouse, it would be nice to be able to simply double click a BASH...

Enabling the xorg record module on Mac OS X Yosemite

osx,x11,xorg,xquartz
I am in the process of porting some code over from Linux to Mac. I am a newbie to Mac so please bear with.... On Linux we have used XRecord from the X11 libraries for input capture. I am attempting to use XQuartz on the Mac as a substitute but...

X11: XRaiseWindow and XLowerWindow do the opposite of what is expected. Why?

x11,xorg
While trying to implement click-to-focus in my custom window manager, I noticed that windows were lowering when I clicked on them, instead of raising. The lines in question looked like this: XSetInputFocus(this->display, this->event.xbutton.subwindow, RevertToParent, CurrentTime); XRaiseWindow(this->display, this->event.xbutton.subwindow); I changed that to XSetInputFocus(this->display, this->event.xbutton.subwindow, RevertToParent, CurrentTime); XLowerWindow(this->display, this->event.xbutton.subwindow); and now...

OpenGL rendering - a window out ot the screen

linux,opengl,glsl,x11
When I draw a triangle and part (or whole) of that primitive is placed outside a viewing volume OpenGL performs clipping (before rasterization). That is described for example here: link What happens when a part of the window is placed outside the screen (monitor) ? What happens if I use...

X11 application cant draw w/ double buffering

c,linux,x11,doublebuffered,xcb
I have a small application written in C running on Linux, that creates a simple X window, with a double buffer, writes some pixels and then flushes. I notice that if I don't add a delay the picture flushed does not appear, what am I making wrong here? The small...