How to get the pid of the focused window on GNOME (Wayland) - gnome

xdotool getactivewindow getwindowpid
I tried this. But it's not working on Wayland. As far as i know. There is no focus window concept on Wayland. So can I get it from Mutter or GNOME-Shell?

Related

How can I get the WID via bash which window the mouse pointer is over?

The question refers to:
Linux Ubuntu, with Cinnamon desktop
Several program windows can be displayed on a desktop.
How can I get the WID via bash which window the mouse pointer is over?
I cannot test this at the moment, but maybe xdotool offers a way to get the window under the mouse cursor. From man xdotool:
getmouselocation [--shell]
Outputs the x, y, screen, and window id of the mouse cursor.
I assume the mentioned window id belongs to the window under the mouse cursor. To retrieve it, use
declare "$(xdotool getmouselocation --shell | grep WINDOW)"
echo "$WINDOW"
The window id can then be used in other tools like xwininfo -id <wdid> to get more information.

Scroll in GVim using touch screen device

I'm using GVim on a Surface Pro 3 that has a touch screen. I've gotten so used to scrolling windows (like the browser) using the touch screen, so I thought it would be nice to be able to do the same in GVim. However, when I drag my finger it selects text rather than scrolling. Is there a way to change that?
Whohooo, my first tumbleweed badge. :-) Anyway, this actually works out of-the-box with the Vim build from https://bitbucket.org/Haroogan/vim-for-windows

With Qt under Gnome 3, Xfce and Unity a full screen window with a child window doesn't stay on top

I have a full screen application based on Qt. Full screen applications should always be on top because otherwise part of the window will be obstructed. I want the frameless full screen window to have child windows (special dialogs, ..). These child windows should be shown on top of the full screen window. Not much sense in showing them below.
A short, self contained example is:
from PySide import QtGui, QtCore
app = QtGui.QApplication([])
window = QtGui.QWidget(f=QtCore.Qt.WindowStaysOnTopHint)
child_window = QtGui.QWidget(window, f=QtCore.Qt.Window)
child_window.resize(400, 300)
layout = QtGui.QVBoxLayout(window)
exit = QtGui.QPushButton('Exit')
exit.clicked.connect(app.exit)
layout.addWidget(exit)
create = QtGui.QPushButton('Create child window')
create.clicked.connect(child_window.show)
layout.addWidget(create)
layout.addStretch()
window.showFullScreen()
app.exec_()
It's written in Python and tested on Python 3.X + PySide 1.2.2 (Qt 4.8) + Ubuntu 14.04 (Unity desktop) or Windows 7. However transformation to C++ Qt (or PyQt) should be straightforward.
The observation is that on Windows everything is as described at the beginning. The Qt.WindowsStaysOnTopHint is not necessary, while on Ubuntu it is.
On Ubuntu I see that initially the full screen main window is on top of everything but as soon as a child dialog window is created the usual desktop decorations (top and left bars) are shown above the full screen main window obstructing part of the view! As soon as the child window is closed the full screen window is on top again.
Question is now if there is anything that can be done to have a full screen window which is on top plus child windows on Ubuntu and with Qt?
The different behavior between Windows and Linux is also not satisfying because OS specific code should be avoided if possible.
Later:
Using the overview of available desktop environment on Ubuntu I installed several environments and tested them.
KDE, Lubuntu (Lxde?) and Openbox work as expected (and equally to Windows). The main window stays on top when shown full screen and child windows are displayed above.
However for Gnome-Shell (Gnome 3), Xfce, Unity and Awesome the desktop decoration stays on top of full screen mode windows of children windows are displayed also. Xfce and Unity behave exactly equal, Gnome and Awesome have even some small additional problems.
Did you tried thing which documentation suggests?
Qt::WindowStaysOnTopHint 0x00040000 Informs the window system that the window should stay on top of all other windows. Note that on
some window managers on X11 you also have to pass
Qt::X11BypassWindowManagerHint for this flag to work correctly.
Another thing why you want other window to be a child if it you what to be under a parent?

Show Ubuntu Unity's Laucher through command line

How can I show Ubuntu Unity's Launcher panel through terminal?
I'm trying to bind a mouse button to this, showing the launcher. By "launcher" I mean the vertical panel with the "Home button". I would like to press this particular mouse button and it acts as if I had pressed the <Super> key; which is bound to show the launcher by default.
I've set xbindkeys properly already. I know I could use xdotool (or xte) to simulate a <Super> keypress event, but I'm not willing to do that. I would rather use a more direct solution. Couldn't find any Unity's interface to do that though. Does anyone?
Thanks in advance.
Did the trick with:
xdotool key alt+F1

keep gtk window fixed on screen

How you keep gtk window fixed on screen like a taskbar or keep some space like taskbar reserved for our gtk window, Do i need to write some WM plugin. if it helps my wm is metacity, and can you integrate gtk with xlib program, actually I was developing a basic WM and feels the need for both xlib and gtk, doing anything with gtk in my wm simply crashes it.
The NetWM/EWMH protocol supports docks/taskbars via setting the _NET_WM_WINDOW_TYPE property to _NET_WM_WINDOW_TYPE_DOCK.

Resources