Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux draw on screen independent of windows manager

Tags:

c++

c

linux

x11

opengl

This is more of a vocabulary question than anything else.

Introduction

I'm using the Point Cloud Library to get face tracking data. Using this data I want to track where a user is facing on the screen. This is not a problem.

Problem

To give user-feedback, I would like to draw the estimation of the user's face-direction as a red circle on the screen, basically as seen here (they just create a tiny window). I would like this circle to be able to go everywhere on the screen and I want it to be always visible. I do not want it to be covered by another active window. If it impedes interaction with the window, I'm fine with that.

My problem is that I do not know where to start.

I could just control the cursor, but that is less then ideal, because I would like to still be able to move the cursor while I'm using face detection.

I think I need to use OpenGL, but all the examples I've seen have been inside X windows. For example, the code I found here after getting a hint here, give me a nice permanent window, but the window still captures all my mouse clicks. How do I draw something on a screen with OpenGL that is X-window independent?

Am I approaching this from the wrong direction completely? If so, what should I be googling?

I will accept any answer that gives me a starting point.

Platform

I am using Ubuntu 12.04 with the Unity desktop.

like image 751
Seanny123 Avatar asked Jul 22 '13 06:07

Seanny123


Video Answer


1 Answers

Create a regular window. Tell the WM to skip decorations ant to keep the window always on top. Use XFixesSetWindowShapeRegion() to separately set a circular output region and an empty input region. You need a compositing window manager XFixes extensions for this to work.

You can also make your window semi-transparent (this needs a compositing window manager).

A modern toolkit such as gtk should have easy to use APIs to do all of the above.

No OpenGL is needed at any stage.

like image 150
n. 1.8e9-where's-my-share m. Avatar answered Oct 22 '22 09:10

n. 1.8e9-where's-my-share m.