How to launch new window below current window using xulrunner - linux

I have situation that I'm calling mplayer every x minutes from xulrunner application and it always gets focus and comes on top, in front of other windows. But I need it to be behind xulrunner which has transparent box in which video should be visible.
Is there some way to force new process (mplayer) to be behind oldier process (xulrunner) and not to get autofocus on it?
Is it a Linux window manager level or there's some property in xulrunner or mplayer? (I'm using Fedora 18 with Openbox)

A solution can be achieved using devilspie. This tool allows you to customize many properties of application's windows including their focus, decoration, placement, and geometry. There is a handy frontend for it called gdevilspie, though there are no rpms available so it must be installed from source.
You can set devilsiie to match on all mplayer windows and set their action to "below" which will place them below all normal windows. Unfortunately this will apply to all invocations of mplayer, so this solution may be annoying if you use mplayer under other circumstances.

Related

How can one greate grid/tile view of selected parts of windows on xfce/linux

I have a few windows on my linux machine using the xfce4 desktop enviorment.
I wish to have a grid-like view where i can see only the part of each window im intrested in.
An example for the general vision:
see a script running without the window borders on terminal across the header
see work status of F#H client out of the advenced client view in the middle left
see only the turrents status list of qBittorrent at middle right
have another terminal at footer (again without header/borders)
My best way to describe it shortly is to generate a view from selective parts of windows.
Added a picture for illustration
Is there any way of doing such thing in a practical way? Am i missing out on a great software?
There are several tiling helpers for Xfce.
Perhaps try xpytile , which is a tiling add-on for Xfce. It offers
automatic tiling, manual tiling and can simulaneously resize side-by-side windows (like AeroSnap for MS-Windows).

Change font style in terminal to a specified .ttf file

I am creating a terminal game which uses a specific font to display graphics. The problem is that it is inconvenient to manually have to switch font every time the game is started and stopped. The game should run on OS X and Linux and should mainly support xterm. Is there any hack which allows this to be automated?
No, there is no generally applicable way of doing this. Sorry.
I can think of a couple specific awful hacks that you could use to change the user's font in specific environments -- for instance, if the user is using macOS and running Terminal.app, you could use Applescript to alter the font. However this trick wouldn't work even if the user were using another terminal in macOS, let alone on Linux.
If you need a specific font, you should write your game to run as a graphical desktop application, rather than in a terminal.

touch events in linux using Qt

I am trying to program touch events in linux using Qt. My touch screen works, however when I touch the screen I get mouse events rather than touch events. The mouse cursor moves to where I touch the screen. I don't know if it is a Qt problem or something that happens at the OS level.
I am using Qt 5.4.0 on Debian Jessie.
Since you did not share any source code, its hard to know what happens wrong on your side. Take a look at this documentation:
Detailed Description of QTouchEvent Class
Touch Input Examples
All that examples works well, and you need to test it on your side. If it will not work for you, it means that there are some problems on your side, otherwise, it mean that you forgot something in your application (like Qt::WA_AcceptTouchEvents attribute set, or not set to true the acceptTouchEvents attribute at graphics items...).

How to get the location of the component of a window in Linux?

In Linux, one can use xwininfo to get the location of a window. Is that possible to get the location of it's component, e.g. the content area of a browser, the button of a window? -children option of xwininfo can only get the location of children windows, not components.
My understanding is that modern toolkits (like GTK+, Qt) do not necessarily back every component with an X11 window, but I find it hard to find a definite source for this claim. If the components, or widgets, are not backed by X11 windows, xwininfo will not be able to determine their location.
For example, GTK+ used to interpret the environment variable GDK_NATIVE_WINDOWS to mean that every GdkWindow (corresponding to every widget) should have a native window, but this was only for compatability with some applications that would not work otherwise. This feature has since been removed (https://mail.gnome.org/archives/commits-list/2011-March/msg03590.html). Gtk+/Gdk now has gtk_ensure_native_window(), but if not enabled explicitly by the programmer, it seems that Gdk will not back the widgets by X11 windows and therefore xwininfo will not be able to pick up the location of these.
It seems that there may be alternatives for specific toolkits though. For example, GTK+ has gtkparasite which might be able to give you the information on specific components, but this will only work for GTK+ applications.

How to change focus in X-Windows?

I am working on old Motif-based application for Linux. I want to be able to programmatically change the active window of our application. I can redirect the input by using XSetInputFocus() function and the keyboard input start to go there, but XReconfigureWMWindow() and XRaiseWindow() functions just don't work.
I've read that Window Managers try to stop this behaviour, so tried to disable configure redirection, but this doesn't work either. Any ideas how to make one of my own windows on top of the window stack?
There is a tiny program called wmctrl available (at least in Debian/Ubuntu it is in standard distribution) which is able to perform many operations on windows and desktops, and handles plenty of window managers. I'd suggest testing whether it works in your environment, and if so, peeking at its sources.
You may find the answer to this is dependent on the Window Manager the user is using, or even what settings they've given to the Window Manager. I like to set my Window Managers to do "focus follows mouse", which means you can't send the focus to a window that I haven't put my mouse on, unless you also warp the mouse there (is that function called XWarpMouse?).

Resources