x11

X11: raise an existing window via command line?

℡╲_俬逩灬. 提交于 2019-11-30 17:40:35
Given an X client window ID, is there a way to raise that window from the command line? $ xlsclients -a Window 0x3000001: Machine: ohm Name: Terminal Icon Name: foo Command: foo Instance/Class: foo/bar $ xraise -id 0x3000001 <-- this is what I would like to do You can also use wmctrl, which does similar things liori Like... http://zaurus.daemons.gr/menaie/build/hacks/xraise/xraise.c ? EDIT: Inserting the code in the answer : #include <X11/Xos.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> /* "borrowed" from xwininfo/dsimple.c */

Using X11 in OSX 10.8.3 : “ld: library not found for -lX11”

走远了吗. 提交于 2019-11-30 17:11:46
问题 I have the following makefile: PROG = draw CFLAGS = -w -s -O2 -ansi -DSHM XLIBS = -lX11 -lXext -lXmu -lXext -lXmu -lXt -lXi -lSM -lICE LIBS = -framework OpenGL INCLS = -I/usr/X11R/include -I/share/mesa/include LIBDIR = -L/usr/X11/lib -L/usr/X11R6/lib #source codes SRCS = draw_main.cpp $(PROG).cpp #substitute .cpp by .o to obtain object filenames OBJS = $(SRCS:.cpp=.o) #$< evaluates to the target's dependencies, #$@ evaluates to the target $(PROG): $(OBJS) g++ -o $@ $(OBJS) $(LIBDIR) $(LIBS) $

Open Browser window from Java program

99封情书 提交于 2019-11-30 17:01:51
问题 Question I have an application written in Java. It is designed to run on a Linux box standalone. I am trying to spawn a new firefox window. However, firefox never opens. It always has a shell exit code of 1. I can run this same code with gnome-terminal and it opens fine. Background So, here is its initialization process: Start X "Xorg :1 -br -terminate -dpms -quiet vt7" Start Window Manager "metacity --display=:1 --replace" Configure resources "xrdb -merge /etc/X11/Xresources" Become a daemon

Capturing Display / Monitor Images, Sending Keyboard Input on Linux

情到浓时终转凉″ 提交于 2019-11-30 16:08:33
问题 I need to process images sent to my laptop's video display, and I need to send keyboard input to my Linux system, using a C++ or shell program. My goal is to process images that are part of an FPS game, then taking action inside that game (hence the keyboard input) based on these images. Instead of trying to understand (if it's even possible) how to interface to game X or Y, using some API, I figured this is the quickest way to interface to any game, hijacking Linux input and output somehow.

Capturing Display / Monitor Images, Sending Keyboard Input on Linux

穿精又带淫゛_ 提交于 2019-11-30 16:08:31
I need to process images sent to my laptop's video display, and I need to send keyboard input to my Linux system, using a C++ or shell program. My goal is to process images that are part of an FPS game, then taking action inside that game (hence the keyboard input) based on these images. Instead of trying to understand (if it's even possible) how to interface to game X or Y, using some API, I figured this is the quickest way to interface to any game, hijacking Linux input and output somehow. Is there any way to do this without any kernel, or device driver hacking? I used recordmydesktop to

Find the name of the X window manager

夙愿已清 提交于 2019-11-30 15:43:01
How do I find the name of the running X window window manager from a program? If I start another window manager when one is already running, then an error occurs, so there must be a way for the other window manager to detect the first one. How does it work? By the EWMH spec , a compliant window manager will set the _NET_SUPPORTING_WM_CHECK property on the root window to a window ID. If the _NET_SUPPORTING_WM_CHECK property exists and contains the ID of an existing window, then a ICCCM2.0-compliant window manager is running. If the property exists but does not contain the ID of an existing

loading ggplot2 (colorspace, actually) opens up x11

北城余情 提交于 2019-11-30 15:15:43
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 RStudio. Whenever I close X11, so goes my R session. My setup: OS X Yosemite 10.10.2 R 3.1.2 Platform: x86_64-apple-darwin13.4.0 (64-bit) ggplot 1.0.0 XQuartz 2.7.7 (xorg-server 1.15.2) OS X also recently (yesterday?) updated the Command Line Tools to 6.2 This problem occurs: In RStudio using a ST3 REPL package the R console How did I mess this up, and

X11 Mouse Movement Event

做~自己de王妃 提交于 2019-11-30 15:01:34
When creating a Window in XLib What are the masks I provide to the SetWindowAttributes.event_mask member? What do I have to pass to the 11th paramater of XCreateWindow() What are the Events I am looking for in the main message loop (Where I use XNextEvent(lDisplay, &xEvent); ? Since X behaves differently than Microsoft's Win32 API, how do I determine if the mouse is over my window or a window in my "Application" and not over the desktop? I have looked for a similar post. If there is already one out there please point me in the right direction. Update For those who want the easy answer to parts

GTK implementation of MessageBox

点点圈 提交于 2019-11-30 14:27:36
问题 I have been trying to implement Win32's MessageBox using GTK. The app using SDL/OpenGL, so this isn't a GTK app. I handle the initialisation ( gtk_init ) sort of stuff inside the MessageBox function as follows: int MessageBox(HWND hwnd, const char* text, const char* caption, UINT type) { GtkWidget *window = NULL; GtkWidget *dialog = NULL; gtk_init(&gtkArgc, &gtkArgv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event),

Embed an app into a window

青春壹個敷衍的年華 提交于 2019-11-30 14:14:30
FvwmButtons (a module of fvwm window manager) has the Swallow function, that embeds the window of an application into a panel. I have to do something like this with Motif and Xlib. I want to embed an Xclock into my application. I guess I have to change the Window ID of the embedded app. How can I do that? the only supported and reliable mechanism is XEmbed, but it requires the embedded app to cooperate. Without a cooperating app, you're in a world of scary hacks. The basic thing you need to do is XReparentWindow() but the problem is that you're fighting the window manager which will also want