FullScreen window is not working properly - qt5

I have a MainWindow supposed to be always on full screen mode. A Dialog pops up when button "Open Dialog" is clicked. On a desktop system, Ubuntu 20.04, the application works correctly.
When a Dialog pops up, the MainWindow remains at full screen mode. However, on JetsonNano Ubuntu 18.04, the Task bar pops up and the MainWindow is not at full screen mode when the Dialog is opened. Has anyone get the same problem? Why is the difference?
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->showFullScreen();
}
void MainWindow::on_btn_dialog_clicked()
{
Dialog *dialog = new Dialog();
dialog->show();
}

Documentation says:
Full-screen mode works fine under Windows, but has certain problems under X. These problems are due to limitations of the ICCCM protocol that specifies the communication between X11 clients and the window manager. ICCCM simply does not understand the concept of non-decorated full-screen windows. Therefore, the best we can do is to request a borderless window and place and resize it to fill the entire screen. Depending on the window manager, this may or may not work. The borderless window is requested using MOTIF hints, which are at least partially supported by virtually all modern window managers.
An alternative would be to bypass the window manager entirely and create a window with the Qt::X11BypassWindowManagerHint flag. This has other severe problems though, like totally broken keyboard focus and very strange effects on desktop changes or when the user raises other windows.
X11 window managers that follow modern post-ICCCM specifications support full-screen mode properly.

Related

IntelliJ IDEA - Find in path is locked in another window monitor

There is a problem in my IntelliJ IDEA. When I open Find in Path it is shown in a modal window in the second monitor instead in a window inside the main window like it did before. There is no way to move that window to main monitor. I don't remember if I change some configuration which caused this problem, but I'm pretty sure not.
I tried to restore default window configuration in Window/Restore Default Layout. But it didn't help. I'd like to restore the previous behavior without reset all configurations (by delete the config folder), since there is a lot configuration I've to do in IntelliJ IDEA before I can get to work.
Below is an image of both monitor windows.
IntelliJ IDEA 2018.1.4 (Community Edition)
Build #IC-181.5087.20, built on May 16, 2018
JRE: 1.8.0_152-release-1136-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.13.0-39-generic
I realize this post is quite old, but I just had the same problem. I could solve it by removing the state of the popup in the workspace.xml. You do not have to delete all you configurations etc for the project.
Just go to workspace.xml -> <component name="WindowStateProjectService"> and then find the problematic popup and delete its state. For me this solved the problem, it's possible though that you actually have to set the x and y coordinates to have the popup show up at the right place (I didn't need to fwiw).
Besides changing configuration file, alternative for me solution (Linux, Ubuntu) is:
closing "Find in path" window with ESC,
opening it again Ctrl+Shift+F.
Only on initial open one will get handle to resize window's width to smaller width then screen if one goes far left or right to the edge of "Find in path" dialog.
When resized to smaller width then screen width, one will be able to
move this dialog to another screen (it seems this is happening due
window edge snapping)
Hope this helps.
After you click on the window header keep moving the mouse pointer to the other monitor until the find window jumps to the other monitor. In some cases you have to move the mouse quite a bit.
Looks like the window can not be in two monitors at the same time.
I have Android Studio 3.6.1
For Mac OS I found that the best solution is to change your main display by draggin the menu bar to where you want your "Find in files"-popup.
I had the same problem with IntelliJ 2020.3.3: The "Find in Path" Window always appeared on the laptop screen instead of the main screen. It was full-width (but not full-height), and I was able to move and resize it vertically, but not horizontally - and thus not onto the screen to the right.
But I was able to drag the window by holding the "Alt"-key while dragging. It was the again-fullwidth on the other, correct screen, but still not resizable in width. After closing and opening again it was still on the correct screen, and not full-width anymore.

NSMenuBar apps influencing (disabling) each others views (NSMenuItem's) ? BUG

I'm working on a NSMenuBar application and another NSMenuBar app seems to influence the display behaviour of my application!? More precisely: Adobe's Creative Cloud Application. When I click on that (creative cloud) Icon, the popup-view appears. Afterwards, when I click on my StatusBar Icon, my Menu appears, BUT, all the NSMenuItem's that should be Enabled are suddenly Disabled, and not interactive anymore.
Some observations:
When I log the enabled-state of the NSMenuItem, it logs correctly as being Enabled, but it is clearly not displaying as enabled (see screenshot), and clicking on it simply closes the Menu without performing the associated action. I do the logging with the following code:
-(void)menuWillOpen:(NSMenu *)menu
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC),
dispatch_get_main_queue(),
^{
NSLog(#"preferences menu-item is enabled: %hhd",[self.preferenceMenuItem isEnabled]);
});
}
The NSMenu I use is set to setAutoenablesItems:NO.
Also, Adobe's Creative Cloud uses a popup-view. And when it is opened, It clearly hovers over the screen-real-estate that my NSMenu is using.
When I try to reproduce this with other NSMenuBar applications (e.g. Apple's Wifi or Bluetooth) it all works. No problem. Then again, those applications don't use Popover-views, and they don't completely overlap the space of my app.
Please see these screenshots as illustration:
Before
Malicious Creative Cloud
After
What Am I missing here? Apps should not be influencing each other like this right? I'm slowly but surely losing my mind over this. Any help MUCH appreciated! Thnx!!
I have found the solution to my own problem. So I hope I will help anybody else struggling with this.
I was using my main xib file menu (with the status-bar) and referenced that menu to open when clicking on the statusbar icon. This caused the app to get in focus and to display two times the same menu (although not open at the same time), one under the statusbar-icon as intended, and one on the left side next to the apple symbol. Whenever the statusbar-menu was somehow getting deactivated, the left menu was still working, as if the focus was shifted to that one.
For me the solution was to decouple my referenced menu from the xib's menu, by dragging it outside the parent-menu. It's weird because somehow it's not visible anymore in InterfaceBuilder, but it's definitely still there. See screenshots:
BEFORE:
AFTER:

Mac development, objective-c: can I detect when user switch tasks like closing a window, activating to another window?

I am developing a desktop application that capture computer activities on mac osx using objective-c. I know it's possible to capture it when user presses on the keyboard and mouse position. But I don't know how to detect when user switches tasks on computer, like closing a window (of other applications), activating another window (of other applications)?
Does anyone have any experience in that?
Yes, via the Accessibility system. For example the NSAccessibilityMainWindowChangedNotification.

Show Networks Flyout (the "connect-to-network" thingie) without explorer.exe running

Requirements:
Our application replaces the usual windows shell (explorer.exe). This is a product requirement for a closed system that we're supplying.
We oughtta let the user select a wi-fi network and connect to it.
The problem: The wi-fi networks dialog only shows up when explorer.exe is running
What we tried:
Write our own wi-fi manager that uses wlan API. It lists connectible networks and allows the user to connect/disconnect. Problem: too many network types/configuratons that have to be tested, especially when the wheel has already been invented and reinvented all over.
Try and check how is the networks dialog implemented. It appears that it's and undocumented COM interface (IUIRAdioManager). Problem: it's undocumented, so no API
Use an existing network manager, for instance the one that comes with the driver. Problems: it's ugly, not to the product's taste; and it opens too many options for the user, like creating and loading profiles, browsing for files on a file system - these things are unacceptable.
Running explorer.exe just for the purpose of showing the networks dialog and then killing it. Problem: once we run explorer.exe - it pops up metro view and hides our fullscreen application or shows the taskbar.
The latter seems like the preferred solution: no need to reinvent the wheel, it does what's needed. Just gotta make explorer.exe not pop out, keep it quiet in the background.
So, we're down to two options:
How to show the networks flyout dialog without explorer.exe?
How to run explorer.exe without it popping out metro or taskbar above our application?
Your first solution would be incredibly difficult to implement. I am almost certain that the Networks window is dependent on explorer.
However, your second is entirely possible.
To hide the taskbar, you will need to find a window (using FindWindowEx) to find the taskbar (name is Shell_traywnd). This will hide the taskbar and start button. EDIT: Unless you are implementing your own taskbar, you might want to set the taskbar to autohide.
Next you will need to hide all of the metro programs. In a similar fashion as above, find the class named EdgeUiInputWndClass and close it. You should be able to get the process name of it and then kill the process.
Windows key. This is a little more difficult. You will probably need to use a program and delete the key or a keyboard hook (a low level keyboard hook) and just ignore key presses with the same scancode as the windows key. Left Windows is 0x5b and Right is 0x5c (source). Note that this will not block Ctrl+Alt+Del.
Finally, to show the Flyout, you can run %windir%\explorer.exe shell:::{38A98528-6CBF-4CA9-8DC0-B1E1D10F7B1B}
(source).
EDIT2:
You should also be able to hide toast notifications via this
Of course, I don't see why you cannot just use Windows 8/8.1 and put the app in kiosk mode.

KDE and Multi-Monitor, how to have program started on the screen it was opened from

I have been trying KDE and customized it enough to my liking. I added panels and application launchers on each screen and windows opened shows on each screen panel.
But whenever I start an application either from the "start menu" or from the quick launch, it position on any screen.
Is there a way to have application started on the screen it was opened?
After spending too much time in settings, google, and Window Rules, I finally found my answer.
In System Settings -> Window Behavior -> Window Behavior -> Focus Tab
enable the box "Active screen follows mouse"