In gnome 3, how to let a window get focus but not on the top? - gnome

Windows get focus is meaning that you can type in something in that. But at the same time, I hope that windows not to cover some others. How to config gnome 3 to implement that?

Leaving a window in focus though not on top of the screen is quite easy in Gnome. It is possible to give each and every window a special attribut which will shift their priority on the screen.
First, right click the titlebar of the application which should always be on top. A small menu should pop up. Now just select the option "Always on top" and you are done. This option may be parsed to multiple windows. Independently of which window is in focus, the application with this attribute will always cover it.
By the way the so called "Titlebar Actions" can be configured through the gnome-tweak-tool. Under the "Windows" tab you may define what should happen on a double click, a middle click or a secondary/right-mouse click.

Related

Change taskbar menu in Tauri

I'm using Tauri and would like to change the menu items shown when clicking my application in the taskbar using the right mouse button (Windows/Linux) or double click (MacOS).
For example Firefox shows "Open a New Window" and music players often show "Play/Pause" or "Next track" buttons. How to do that with Tauri?
I'm aware of SystemTrayMenu in Tauri, but that only seems to affect the system tray, not the task bar.
(What I mean by "taskbar": the line of application icons that you click to open them, and that usually indicate which ones are running. I think MacOS calls it Dock, in Windows it's at the bottom between start button and clock, and Linux isn't very homogeneous but in Ubuntu it's vertically on the left by default. I do not mean the system tray of usually smaller icons that are almost always next to the clock, that are usually more like background services. I.e. I mean where your browser usually shown up, not where your VPN usually shows up.)
Tauri does not support this at the moment (2022-06-27). You may file a feature request.

PyQt: How do you clear focus on startup?

When I start up my PyQt GUI, the focus immediately goes to the text box.
I want there to be no focus on any of the buttons at the start of the program, especially not the text box.
Is there a way to remove the focus entirely or at least move the focus to a button or something?
Thanks
clearFocus() seems to work after a certain amount of delay after the window is visible. I also used setFocus() on the QMainWindow and then the textedit field lost focus.
Create a button with dimensions 0 wide by 0 high.
Set it as the default button and also early in the tab order before the other controlls that except focus; but note that it will be triggered if the user presses ENTER in some edit controls.
Call self.ui.yourbutton.setFocus() if desired for example after restore from minimized

Android studio documentation popup

Is there a way when documentation popup on AS to not hide immediately after it is showed by moving mouse on some class. What I mean. I move mouse cursor above Activity class and documentation is popup is showed, but when I try to move mouse above this popup (because I have to scroll it) it disappears. I can hold ctrl and then is will not hide, but if I press on it while holdint ctrl down it will disappear (so I should move cursor above it, release ctrl and after that to start scrolling). So is there an option to change this behaviour to be like in eclipse - documentation pop up is showed and if you move mouse above it you can scroll, otherwise it is closed.
There are a lot of bugs surrounding this UI element. I'm currently having the opposite problem where it won't go away unless I manually close it. I suspect in your case, a timeout is triggering too early, or some other event is erroneously hiding the window.
This workaround may be helpful. You can explicitly pop the documentation window from the View > Tool Windows > Documentation menu option. This will cause the tool window tab to appear on the right gutter by default. Right-clicking on the Documentation tab will pop up a menu that will allow you to pin the window, or dock it permanently in the UI by disabling "Floating Mode" and optionally moving it to the other side or the bottom.

How to deactivate window in Qt

I am trying to create a dockable window in Qt (it sits taking 4px width at the edge of the screen, always on top and it slides out when you hover it). I have to use WindowFlag BypassX11WindowManager (in order to hide taskbar hint, disable moving/resizing/etc. from window manager). I use these flags:
Qt::FramelessWindowHint
Qt::CustomizeWindowHint
Qt::X11BypassWindowManagerHint
Qt::WindowStaysOnTopHint
When I need my dock to be activated, I use the activateWindow() method. However, I have no idea, how to deactivate it.
Is there a way I can force my window deactivate? Now I can do it only by clicking another window and then return to the one that was active before revealing dock.
You should be able to use ->hide() to simply hide it if you don't want it to appear at certain points.
I assume, by the way, you know there is QDockWidget/ class that may help you as well. It's unclear from the above if you're using it or not.

System wide right click context hook

**Hello..
i am creating English To Gujarati Dictionary WinForm Application.
I need to set a system wide hook to the right click context menu on for text selection.
it means when this application is running,and if user selects word from any program and right click on it gujarati meaning of that word should be displayed as menu item.
How to do this?
or any other options like Registery Programming,shell extentions etc...?
i have to do this,even if you say its not possible.
so please help me.**
Hooking the mouse activity is the easy part. See SetWindowsHookEx, and lots of questions regarding hooking in SO. This way, you can tell when the mouse is right-clicked.
Getting the selected text is the harder part. See WindowFromPoint, for starters. You'd have to recognize the control, and if appropriate get the selected text from it. This will not always be possible using simple Win32 functions, if the control is complex.
Adding the translation to the right-click menu is probably the impossible part. Adding stuff to explorer context menu is not a problem, because explorer provides that possibility. But various applications will have various right-click menus, without a way to extend them. They might not even use Win32 for the menus, for whatever reason. A better option, IMO, would be one of the following:
Forget about changing the right-click menu. Open a window next to the point of selection with whatever content you want, and let the application show its own right-click menu.
If the user right-clicks while, say, pressing shift, show your own right-click menu, and don't pass the message to the application. So the user will see only one menu, which is yours. The user must of course be aware of this combination.

Resources