x11

Touchscreen Kivy app for Raspberry Pi

[亡魂溺海] 提交于 2019-12-03 17:28:46
Here's the scenario: I've written a gui using the python framework Kivy , and I want to run it on a raspberry pi with this touchscreen . I've done the installation fine, and TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen FRAMEBUFFER=/dev/fb1 nohup startx & gets the xwindow desktop gui running fine. I've been unable to get my kivy gui working, though. I was able to get a test tkinter application working ok, by setting the DISPLAY environment variable. I tried putting the following at the top of my kivy app, but to no avail: os.environ['SDL_VIDEODRIVER'] = 'fbcon' os.environ['SDL

Window position in Xlib

亡梦爱人 提交于 2019-12-03 16:51:14
How to get top-level window position relative to root window (i.e. whole screen) using plain ol' xlib (or brand new XCB)? The x,y components of the structure returned by XGetWindowAttributes are relative to the origin of the window's parent. That's not the same as relative to the top left of the screen. Calling XTranslateCoordinates passing the root window and 0,0 gives coordinates of the window relative to the screen. I found that if I write: int x, y; Window child; XWindowAttributes xwa; XTranslateCoordinates( display, window, root_window, 0, 0, &x, &y, &child ); XGetWindowAttributes(

Mac OS X Window Server vs. X11: the insane task

岁酱吖の 提交于 2019-12-03 16:29:53
Dedicated to all who likes low-level Window Server (CoreGraphicsPrivate.h, etc), X11 on Mac, SIMBL and other crazy stuff :) There's a simple X11-emulated application on Mac (like xterm, xeyes and so on) with one window. While running, X11 somehow creates a native Quartz window to represent this emulated application, and this window is accessible via Quartz Window Services so that I can get its CSWindowID, title, position, size and owner's PID (PID of X11.app). But it does not support Accessibility API, so there's no way to control it (except, maybe Core Graphichs private functions from the

Load image onto a window using xlib

隐身守侯 提交于 2019-12-03 16:18:40
I've created window class and i want to insert an image as a background of that window. File formats need to be png. I used XImage of magick++ to load an image. but don't know how to make its as a background of my window. Any idea how to do it? Create an Pixmap using Pixmap XCreatePixmap(display, d, width, height, depth) Display *display; // The display Drawable d; // The Window for which to set the background Create a Graphics Context for the Pixmap GC XCreateGC(display, d, valuemask, values) Draw the XImage to the Pixmap XPutImage(display, pixmap, gc, image, src_x, src_y, dest_x, dest_y,

Python: tell X to reserve screen space for application

送分小仙女□ 提交于 2019-12-03 15:47:47
I am trying to solve the issue of reserving space on the screen for an application with X Window Manager (i.e. Linux platforms). I have seen this issue addressed and solved for Gtk and I asked the prompted the same question using Qt . Since no one reacted to the Qt-specific question (which I also addressed in other forums), I thought I'd generalise my question: Is there a universal, pythonic way to tell X to reserve screen space for an application? Thanks, Benjamin After some research i found the solution using Python-Xlib . In the code that generates the window, it is possible to get the

Does OpenGL use Xlib to draw windows and render things, or is it the other way around?

一个人想着一个人 提交于 2019-12-03 15:47:15
I want to render fonts and lines on a window using either OpenGL or Xlib , but I'd like to know which one is "more fundamental". Using the Xlib interface I can render such things with something like this (which I found here ): // gcc x_1.c -o x_1 -lX11 && ./x_1 #include <stdio.h> #include <X11/Xlib.h> // This program draws a red line and some text in a chosen font. Display *display; Window window; XSetWindowAttributes attributes; XGCValues gr_values; XFontStruct *fontinfo; GC gr_context; Visual *visual; int depth; int screen; XEvent event; XColor color, dummy; int main() { display =

How to query X11 display resolution?

 ̄綄美尐妖づ 提交于 2019-12-03 15:41:12
问题 It seems like an simple problem, but I can't find the answer: How do you query (via X11) what monitors exist and their resolutions? 回答1: Check out display macros and screen macros from the Xlib manual. Specifically: From the first link: ScreenCount() , ScreenOfDisplay() From the second link: WidthOfScreen() , HeightOfScreen() 回答2: This might be helpfull for cli and scripting xwininfo -root But xRandR might be more accurate, especially, when there is multiple monitor environment: xrandr 回答3:

What do I need to do to link with xlib?

早过忘川 提交于 2019-12-03 14:56:48
问题 I am using GCC, what switches do I need to add to link with Xlib? After searching, all I could find was -lX11 , but that gave me ld: library not found for -lX11 I am using a mac (10.6), but I would not like anything that is Mac specific. 回答1: You can usually use pkg-config to determine the flags you need to pass: gcc my-program.c $(pkg-config --cflags --libs x11) -o my-program 回答2: $ locate libX11 /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.6.2.dylib /Developer/SDKs/MacOSX10.4u.sdk

In Vim, is there a way to copy the current line number into a buffer?

风流意气都作罢 提交于 2019-12-03 13:48:56
When using gdb and Vim, often I want to stop on a particular line. Normally in Vim I copy-paste the line number showing on the rule area to the gdb session. It'd save me a lot of hassle if I could use something like "+<magic-incantation> to copy the line number of the current cursor position into the xclipboard buffer. Is this possible? Gowri put this in your vimrc map ,n <Esc>:let @*=line(".")<CR> then using , n will copy the current line number into the clipboard So the magic line is: :call setreg('*', line('.')) The reason: The register * hold the clipboard line('.') holds the current line

Could not find any X11 fonts error

让人想犯罪 __ 提交于 2019-12-03 12:46:41
I am starting to get into R development and I was following a tutorial that in a certain point opens the "X11" to display graphics but when that window opens I get the following error: Error in axis(side = side, at = at, labels = labels, ...) : could not find any X11 fonts Check that the Font Path is correct. In addition: Warning messages: 1: In function (display = "", width, height, pointsize, gamma, bg, : locale not supported by Xlib: some X ops will operate in C locale 2: In function (display = "", width, height, pointsize, gamma, bg, : X cannot set locale modifiers I have been Googling