x11

Is a “monitor” in Gtk3 the same as a “Screen” in X11?

我们两清 提交于 2019-12-25 09:15:17
问题 I wrote an application in Gtk3 using gdk_display_get_monitor_at_window and gdk_monitor_get_geometry . Out of 75 gtk functions that I used, these are the only 2 that are causing problems for people trying to compile on Ubuntu because most people are not running a version of Ubuntu that has gtk3 3.22. My application also uses X11, so I want to replace these functions with X11 equivalents. After briefly looking at X11, I have some questions: Is a Gtk "monitor" equal to an X11 "screen"? If the

Xft can draw rectangles on Pixmaps, but not text

吃可爱长大的小学妹 提交于 2019-12-25 07:37:26
问题 I am trying to render some text with Xft and set the resulting Pixmap as X root background. Despite having some diplomacy with X, the code I have is simple: #include <stdio.h> #include <unistd.h> #include <X11/Xlib.h> #include <X11/Xft/Xft.h> int main() { char font[] = "helvetica:size=11"; char buf[] = "Lorem Ipsum"; int s, x = 12; XRenderColor color = {0xFFFF, 0, 0, 0xFFFF}; Display * d; Window r; Pixmap p; XftFont * f; XftDraw * drw; XftColor xftc; d = XOpenDisplay(NULL); s = DefaultScreen

How to use Openbox+xcompmgr correctly?

泪湿孤枕 提交于 2019-12-25 07:24:23
问题 I use xcompmgr to make the 32 bit window to has a transparent background.The WM is Openbox.But When I run my 32 bit window example,the window is black not transparent.The result I want is set something make xcompmgr work fine.I saw a page "Background turns light gray briefly after logging in (e.g. in Openbox)", hsetroot .I run hsetroot,my window become steady,but like a 24 bit window with a black background.Is there any ideas to meet my demand? 回答1: Even if this message is quite old, maybe I

Determining path to current wallpaper with pygtk (maybe X11?)

余生颓废 提交于 2019-12-25 05:33:10
问题 I would like to determine a user's wallpaper path with PyGTK. If possible, I would like to not rely on a Desktop Environment's function to do this - this is because some users(like myself) do not use a DE. Because of this, I am wondering if you can use X11 or something else to determine the current wallpaper being used. 回答1: You MUST rely on a desktop environment, otherwise it is not possible, since X11 isn't supposed to handle such things as wallpapers. When you set a background image, an

Determining path to current wallpaper with pygtk (maybe X11?)

一个人想着一个人 提交于 2019-12-25 05:33:02
问题 I would like to determine a user's wallpaper path with PyGTK. If possible, I would like to not rely on a Desktop Environment's function to do this - this is because some users(like myself) do not use a DE. Because of this, I am wondering if you can use X11 or something else to determine the current wallpaper being used. 回答1: You MUST rely on a desktop environment, otherwise it is not possible, since X11 isn't supposed to handle such things as wallpapers. When you set a background image, an

Proper algorithm for XQueryTree to get in z order

雨燕双飞 提交于 2019-12-25 03:14:09
问题 I was trying to get all the windows in z order but the algorithm for XQueryTree is confusing me. This is what I did: my collection array: [] I start with root window lets call this A , I push this to start of array. So [A] XQueryTree gives me a list of a children lets call them B, C, D I push first child to start of array so it is now [B, A] It XQueryTree B and finds children B1, B2 It pushes B1 to start so now: [B1, B, A] XQuertyTree on B1 shows no children so continues It pushes B2 so now

Error when trying to build a Global Keyboard Hook in Ubuntu Linux

为君一笑 提交于 2019-12-25 02:38:50
问题 I'm developing a code to get keyboard input in KeyPress and KeyRelease events, but when i run the program nothing happens, what is wrong with my code? And how to get the pressed key value? void hook() { forever { XEvent event; Display *dpy = XOpenDisplay(NULL); XNextEvent(dpy, &event); switch (event.type) { case KeyPress: qDebug() << "keypress"; break; case KeyRelease: qDebug() << "keyrelease"; break; } } } 回答1: Read more about keyboard X11 events. You will get them only from some X11 windows

How to get XWindow ID in GTK3?

旧时模样 提交于 2019-12-25 01:54:24
问题 In GTK3, how do I retrieve the XWindow ID? I didn't see anything related to this in GdkWindow. In documentation, it is said there is a GDK_WINDOW_XID() macro. However, I cannot find the equivalence in Python binding. 来源: https://stackoverflow.com/questions/14732838/how-to-get-xwindow-id-in-gtk3

Getting key name from keycode (X11 XGrabKey)

孤人 提交于 2019-12-25 01:46:04
问题 I have a global key event handler in linux as below. I need to know which keyboard is grabbed. For example if key 'P' is pressed I get the corresponding key code. Is there any way to get the key name ("P") from this unsigned key code ? #include <xcb/xcb.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <QtX11Extras/QX11Info> void EventFilter::setup(QWidget *target) { this->target = target; Display * display = QX11Info::display(); unsigned int modifiers = ControlMask; keycode =

How to save ggrough chart as .png

妖精的绣舞 提交于 2019-12-24 19:09:19
问题 Say that I am using the R package ggrough (https://xvrdm.github.io/ggrough/). I have this code (taken from that webpage): library(ggplot2) library(ggrough) count(mtcars, carb) %>% ggplot(aes(carb, n)) + geom_col() + labs(title="Number of cars by carburator count") + theme_grey(base_size = 16) -> p options <- list( Background=list(roughness=8), GeomCol=list(fill_style="zigzag", angle_noise=0.5, fill_weight=2)) I can then create the chart (I am using RStudio): get_rough_chart(p, options)