Is there a way to make a Qt window (qml with pyside2) to never minimize?
(Not the minimize button)
I'm trying to achieve something like conky (Linux) or rainmeter (Windows) with python 3 and qml (Qt).
I want a borderless window to stay on the back of the screen and stay there no matter what as if it's part of the wallpaper. Making the window borderless was achieved with the Qt.SplashScreen flag but disabling minimize turns out to be much harder than I initially thought. All the methods I've tried hides the window when win+D is pressed.
Related
I would like to be able to toggle between framed and frameless window in my Electron app, without needing to construct a new window. This is because this option is a different view than what would be initially loaded, therefore it would be nice if there is a way to change the current window to be frameless.
I have found window.setFullscreen() for toggling between full screen mode. I've not been able to find anything similar for frameless window. Is there any such method or workaround that I'm not seeing?
As the docs go, you enable or disable window frame at the time of creation of browser window. After that, there are no methods you can call to enable or disable frame. However, if you really really want that option, there may be a workaround. And a workaround, is well, a workaround.
Create 2 browser windows, one over the other. The first one being transparent window(with frame and click-through) and the second one being your content window(without frame).
Implement your custom solution to keep size and position of both the windows in sync. Use ipc to share data between the windows.
Toggle the visibility of the transparent browser window to show/hide frame.
Some relevant resources:
Creating frameless window : https://electronjs.org/docs/api/frameless-window#create-a-frameless-window
Creating transparent window : https://electronjs.org/docs/api/frameless-window#transparent-window
I'm looking for a way to make a toplevel window transparent for mouse clicks and keyboard events. So basically it has to be only visible for the user, not interfere with what else happens on the desktop. (will be transparent) I looked at various options like setting a mask, but that also makes the window disappear where the mask is set. So what I need is a mask, only for user actions, not for visibility.
I got this to work in PyGtk using input_shape_combine_mask()
which accesses x11 shape extensions. I looked for a similar function in PyQt but couldn't find it. In other posts I find it has been done in PyQt under windows. But x11 I couldn't find yet. Any suggestions?
I am trying to programmatically move a window so that it is partially on screen. For instance, clicking the VLC title bar and dragging it so that only half the window is visible works just fine.
When I output the results of wmctrl -lG this works just fine:
0x04a00011 0 -293 138 600 420 HEVM002 VLC media player
However, when I then move it back on screen and try and replicate its position, it doesn't work and clips the window to the far side:
wmctrl -r "VLC media player" -e 0,-200,0,800,600
I have tested on a couple of window managers, and it seems to work fine on xfwm but NOT on compiz. Is there a flag or something like that I can set to enable moving windows off-screen?
When running under a window manager, this is entirely up to the window manager. Whether there is a flag to force partial off-screen positions depends on which window manager it is.
The only window manager agnostic way of achieving this is making the window an override_redirect window. But, of course, this means the window is no longer managed. Making it a normal window again will cause the window manager to manage it again which likely, again depending on the window manager, means forcing it to be in-bounds again.
That said, looking at wmctrl's source code, it uses _NET_MOVERESIZE_WINDOW if supported by the window manager and falls back to XMoveResizeWindow (or similar) otherwise. However, in the first case it casts the position values to unsigned long first which effectively means any negative values will be lost anyway. In the second case, negative values seem to signal "don't move", so no luck there either.
You could try using xdotool windowmove instead which will deal with negative values correctly. Maybe also consider filing a bug against wmctrl?
I have not used Selenium myself, but I was wondering whether the browser window needs to be maximized during test execution? I have used some other tools where the mouse pointer does not find the correct HTML element if the window is too small.
Selenium 2.0 (WebDriver) automatically attempts to scroll an element into view when you're going to perform any action on this element. If it can't scroll it throws an exception. So, don't make your window too small, but there is no need to maximize it. Keep it "mid-size".
For the abovementioned reason, you may want to maximize the browser window to avoid excessive scrolling, that can cause some unnecesssary events on the page.
Sometimes Selenium (WebDriver) can't click an element if it is placed too close to the viewport border (half-visible). In this case you can try to tune the window size to make this element either totally visible, or totally invisible (to activate auto-scrolling).
If you use Selenium (WebDriver) with "native events" enabled, you'd better keep the browser window in foreground and in focus during test execution. No matter whether it is maximized or "mid-size" -- just don't minimize it!
If you're happy with "synthesized events" -- many chances for your tests to run successfully in foreground.
No, because Selenium uses the DOM Structure to act on and not the OS(mouse, windows and stuff). You can actually minimize your window during a test.
Maybe not maximized, but probably best to have test at set minimum and maximum size.
An idea would be to have selenium resize the window for you before it runs the tests... A quick search gave me this: https://makandracards.com/makandra/9773-how-to-start-selenium-browser-with-custom-window-size
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.