I created a PyGTK application which needs to be always on top. The transparent window redirects mouse clicks to the window below and therefore gets out of focus once you click into an underlaying window. This is the intended behaviour. In fact it should just show a little image that's always above everything.
This works well unless you use something like the libreoffice fullscreen presentation. The presentation window is marked as always on top as well and hence my window goes into the background. Even if I take it to front using Alt+Tab and then click onto the underlaying libreoffice slide (which is neccessary) my window goes into the background again.
This is a really specific question and the solution should work on both Linux and Windows. I have no idea what I should do. I just found many questions on how to have a windows always on top but none of them covering my problem.
Long story short: How can I put my window always on top of every window that is always on top as well?
Simple Answer: You can use 'Always on Top' in windows with by using AutoHotKey scripts.
Follow these steps:
Install AutoHotKey
Create a new AHK scripts following the images
Add this code ^SPACE:: Winset, Alwaysontop, , A
Next, double-click your script to run it. You’ll know it’s running
because a green “H” logo appears in your system tray to let you know
it’s running as a background process.
Now press Ctrl+Space to set any currently active window to be always
on top. Press Ctrl+Space again set the window to no longer be always
on top.
Related
I've been looking for a way to screenshot a window that is not on top. It's not minimized, just covered by another one which is active.
For instance, let's say I want to screenshot an online chat (window 1, not active, running in the background, not minimized) while watching a youtube video (window 2, active, showing on screen).
I'm pretty sure there are ways to do this, most of flash application keep rendering even when covered by another window.
Currently, I havn't found anything reliable.
I have been looking at C++ solutions and python ones (but I'd rather have a python one). A VBA one would be great too since I often work with macros.
I also though of creating a virtual dual screen, and assigning the window I want to screenshot to it, to have it rendering the window. But I don't know how and if it could work.
If you have any ideas, let me know :)
Thank you
There is command In the AutoHotKey that shows tooltip with some message on the top of the screen. I want to do it on python.
In more details I need to make an application, that will work in background, always tracking a keyboard. On the specific hotkey it should show on the top of the screen a message without grabbing focus from other application. And it should remove this message after some conditions (e.g. mouse moving). It should work with full screen apps too.
I couldn't find how to do it on python, or what libraries should I use. Need your help.
Global tooltips are created via WINAPI CreateWindowEx with TOOLTIPS_CLASS for window class. There are some examples which you can adapt. See also the Autohotkey implementation.
Shell tray tooltips are created via Shell_NotifyIcon.
A working example: wontoncc/balloontip.py and the Autohotkey implementation.
Pressing command-H in OSX immediately hides the active window. How do I achieve the same effect, programmatically, from Python? Specifically, I'd like to find a particular window that my application creates and then be able to show & hide it programmatically.
I already know how to do this with pywin32 but I'm afraid my expertise there doesn't quite cover OSX as well.
If it helps, the window in question is one created by pygame. I know that pygame has pygame.display.iconify() but that doesn't satisfy my requirements - the window doesn't disappear immediately, but rather the disappearance is animated, and there's no corresponding "uniconify" function that I can find.
Well, this ended up working. When I want to hide the window, I do pygame.display.quit() and make my code properly handle not having a display. When I want to show it, I do pygame.display.set_mode(...) with the former resolution.
The net effect is that of hiding & showing the window. Unfortunately the window gets created in a different spot than where it started, and although apparently you can tell SDL to create the window in a particular spot, I haven't been able to find a way to get the window's location...
I've got a program which is using multiple monitors. The program is showing special visualizations on the second monitor. At one point, the program uses windows shell functions to send files to the recycle bin. However, when it does this, the delete confirmation dialog comes on top of my visualization. This is particularly problematic, as when the mouse is on the second monitor, my program uses mouse hooks to capture all mouse input, so the user cannot even click the confirmation dialog.
Is it possible to somehow tell Windows to only place dialog boxes on a particular display?
I'm using python, though if I have to call C WinAPI functions that shouldn't be a problem
which function are you using to send the files to the recycle bin? if you use SHFileOperation you can pass a parent HWND. perhaps make that an invisible WS_EX_TOOLWINDOW window on the other monitor.
i would expect the API, treating that window as a parent, would center relative to that window, but i haven't tried it.
depending on which version of Windows you are targeting, there used to be a capability to create desk bands that 'dock' to the sides of the screen. this automatically gets factored into the area returned as rcWork by GetMonitorInfo and should prevent dialogs from overlapping this space. There might be another way to declare that a region is "in use" in a way that declares space off-limits, but I don't know of it so it probably doesn't exist...
the ugly and crude thing you could do is poll and move the dialog yourself, but if this is any kind of widely deployed or commercial app that would likely cause more harm than good.
The standalone flashplayer takes no arguments other than a .swf file when you launch it from the command line. I need the player to go full screen, no window borders and such. This can be accomplished by hitting ctrl+f once the program has started. I want to do this programmatically as I need it to launch into full screen without any human interaction.
My guess is that I need to some how get a handle to the window and then send it an event that looks like the "ctrl+f" keystroke.
If it makes any difference, it looks like flashplayer is a gtk application and I have python with pygtk installed.
UPDATE (the solution I used... thanks to ypnos' answer):
./flashplayer http://example.com/example.swf & sleep 3 && ~/xsendkey -window "Adobe Flash Player 10" Control+F
You can use a dedicated application which sends the keystroke to the window manager, which should then pass it to flash, if the window starts as being the active window on the screen. This is quite error prone, though, due to delays between starting flash and when the window will show up.
For example, your script could do something like this:
flashplayer *.swf
sleep 3 && xsendkey Control+F
The application xsendkey can be found here: http://people.csail.mit.edu/adonovan/hacks/xsendkey.html
Without given a specific window, it will send it to the root window, which is handled by your window manager. You could also try to figure out the Window id first, using xprop or something related to it.
Another option is a Window manager, which is able to remember your settings and automatically apply them. Fluxbos for example provides this feature. You could set fluxbox to make the Window decor-less and stretch it over the whole screen, if flashplayer supports being resized. This is also not-so-nice, as it would probably affect all the flashplayer windows you open ever.
I've actually done this a long time ago, but it wasn't petty. What we did is use the Sawfish window manager and wrote a hook to recognize the flashplayer window, then strip all the decorations and snap it full screen.
This may be possible without using the window manager, by registering for X window creation events from an external application, but I'm not familiar enough with X11 to tell you how that would be done.
Another option would be to write a pygtk application that embedded the standalone flash player inside a gtk.Socket and then resized itself. After a bit of thought, this might be your best bet.
nspluginplayer --fullscreen src=path/to/flashfile.swf
which is from the [http://gwenole.beauchesne.info//en/projects/nspluginwrapper](nspluginwrapper project)
Another option would be to write a pygtk application that embedded the standalone flash player inside a gtk.Socket and then resized itself. After a bit of thought, this might be your best bet.
This is exactly what I did. In addition to that, my player scales flash content via Xcomposite, Xfixes and Cairo. A .deb including python source be found here:
http://www.crutzi.info/crutziplayer
I've done this using openbox using a similar mechanism to the one that bmdhacks mentions. The thing that I did note from this was that the standalone flash player performed considerably worse fullscreen than the same player in a maximised undecorated window. (that, annoyingly is not properly fullscreen because of the menubar). I was wondering about running it with a custom gtk theme to make the menu invisible. That's just a performance issue though. If fullscreen currently works ok, then it's unneccisarily complicated. I was running on an OLPC XO, performance is more of an issue there.
I didn't have much luck with nspluginplayer (too buggy I think).
Ultimately I had the luxury of making the flash that was running so I could simply place code into the flash itself. By a similar token, Since you can embed flash within flash, it should be possible to make a little stub swf that goes fullscreen automatically and contains the target sfw.
You have to use Acton script 3 cmd:
stage.displayState = StageDisplayState.FULL_SCREEN;
See Adobe Action script 3 programming.
But be careful : in full screen, you will lose display performances!
I've got this problem ... more under Linux!!!