Programmatically signal LXDE desktop manager to hide its start panel? - qt5

I'm working on a RaspberryPi with a 3.5 inch LCD screen. I have a Qt 5 based application that operates in kiosk mode without a title bar. The app uses the entire 320x480 screen. I want to hide the LXDE start panel to reclaim the pixels for my app.
I found several posts that detail configuration changes for LXDE to hide the start panel. For example, here and here. They provide answers like edit /etc/xdg/lxsession/LXDE-pi/autostart and restart.
I'm trying to do the same programmatically. LXDE has a Wiki but I don't see an API to dynamically configure it.
My first question is, how do tell LXDE to hide its start panel? I'd like the start menu go away, or ensure my app is layered on top of the start panel. I would like to do something like this:
MainForm::MainForm(QDialog *parent)
: QDialog(parent)
{
ui.setupUi(this);
LXDE* lxde = getDesktopManager();
lxde->hideDesktopPanel();
}
If it is not possible to do at runtime, then my next question is, can I run the RPI with only X11? In this case I can remove the desktop manager because I don't need it. Qt can talk to X11 the window manager directly.
PCManFM and friends are pretty much useless on the 3.5 screen, so I don't really care if the solution is to remove the desktop manager.

A workaround is to use showFullScreen() that makes the GUI occupy the entire window.

Related

xmonad only shows wallpaper with no icons

So I am testing Arch Linux because I was considering switching. I am running Arch on the latest version of VirtualBox. After I set up the xmonad tiling window manager and rebooted, only the wallpaper popped up. There was no dock, no icons, and no mouse. After reading the manual 2 times over, nothing helped. If anyone knows how to get xmonad to work, that would be great.
Thanks!
I have been using XMonad on Arch for nearly an year now, so I guess I am eligible to answer this.
As per my understanding, you have installed xmonad, xmonad-contrib and xmobar from the Arch official repos. Now, the first thing that you should do is make a configuration file, both for XMonad itself, and XMobar, which is its status bar. Your xmonad configuration goes in ~/.config/xmonad/xmonad.hs (default) or ~/.xmonad/xmonad.hs. XMobar config goes in ~/.config/xmobar/xmobarrc0.hs. If you are using a login manager, xmonad will start as usual, else just use ~/.xinitrc with exec xmonad command for starting xmonad.
Now, as you mentioned, wallpaper is being displayed for you, which might be due to nitrogen or feh or anything similar that is autostarting and setting up your wallpaper. Else, everything you want, you have to set it up yourself in the xmonad config file. The wallpaper also doesn't start by itself if you have a clean install. XMonad just gives a black screen with a black cross for the mouse pointer.
Dock: There isn't any dock on xmonad. If you want a status bar, you can use xmobar or polybar or anything else. I use xmobar with clickable objects, which acts like a dock. Configure it as you want.
Icons: Window managers have a keyboard-driven workflow. You can define workspaces which are clickable, and have your mouse do the switching. But you won't have icons on your Desktop with your files. For that, use any Desktop Environment. You can use xmonad with KDE, Xfce, etc. too, if you want that specific workflow.
Mouse: Well, you should have a cross for a pointer, even if you do not setup anything. If that isn't working, then there is some issue with the drivers that were loaded. But, for a proper arrow-shaped pointer, you can set it up in the xmonad config itself.
Now, you might wonder how you will launch applications if there is nothing to click. For that, you have dmenu, rofi and many other prompts which you can setup. For me, the super key launches rofi in a nice, centered window with application names and icons and fuzzy searching enabled. Configure to your heart's content. A window manager showcases your creativity.
Hope I could give the helping-hand to know what is possible. If you want some ready-made configurations, look for DistroTube's dotfiles.
I am answering because I do not have enough reputation to make a comment. Sorry :|
Xmonad is a tiling window manager and that is all it is. It really doesn't have the concept of desktop icons. Nor does any tiling window manager. A tiling window manager is just all about managing your windows. For status and dock, you usually pair a different program (Xmobar, Polybar etc).
But hold on, if there are no icons, how do I access the applications? Well that's one point about it. Tiling window managers' key selling point is the extensive usage of "Keyboard Shortcuts" People use tiling window manager mostly for the benefits of usage with keyboard.
It takes time to get used to, but has its benefits. If it feels strange and uncomfortable, maybe tiling WMs are not what you want.
Also, this question doesn't belong in here. SO is only for programming related questions. You have other Stack exchange sites for these (SuperUser, Unix/Linux, AskUbuntu, etc)

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.

when using intellij running dual monitors on ubuntu, how to get menu to get menu popup not to drift back to first window?

I use idea on ubuntu linux w/ 2 monitors. I often pull up 2 projects so I can copy stuff from one to the other, and I have one project in a window on
one monitor screen, and the other on the second screen.
My problem is this: when I open the second project in the 'non-primary' monitor screen, and i click on an item in the top level menu bar
the menu pop up displays on the primary monitor screen...not the secondary one... it does not matter if I have the project in the secondary
monitor window maximized or not... the pop up just drifts over to the primary monitor screen..
it is not a fatal error.. I can move my mouse over to the first monitor window and click on the sub menu i want..
but it is so annoying. I'm wondering if this is a bug, or perhaps there is a work around for it ?
Also posted on IntelliJ user community board. If they answer, I will post the response here.
That is unfortunately a Ubuntu specific bug. I recommend you vote for and track it: Pop-up dialogs are sometimes misplaced on Ubuntu 12.04 with dual screens
I can suggest 2 workaround solutions for this issue.
Workaround 1
I use Intellij on my right hand side monitor. But the menus are displayed on left hand side monitor. So, I opened "Displays" configuration and moved the right hand side monitor to the left. Now, the menus are displayed on the correct monitor. Note that, the monitor is still stays on my right hand side:).
Workaroud 2:
Downgrade to JDK 1.6.

The form fails to popup in windows 8

I have a chat application written in VB.net which is used to chat between users who are connected in LAN inside a office . The application popups whenever user gets new chat message. It works fine in windows XP. But sometimes in windows 8 the application fails to popup the chat window. So my chat window is not appearing at the top when popup occurs for new messages.
I have tried using setwindowspos, form.Show(), form.BringToFront() which can bring the form to topmost. But sometimes this will not work properly.
So is there any other method other than those three(which i have mentioned above) i have used which can make the form popup and bring it to front.
Your WinForms app is a desktop application, so it's likely that the reason the pop-up is not being displayed in Windows 8 is because the desktop is not visible.
Remember that Windows 8 brings with it a whole new Start Screen interface and relegates the desktop to an alternate mode. All desktop applications still run, but they run in this separate mode and cannot interact with the new Metro applications (or whatever they're calling them nowadays). Yes, it's too bad that the usability folks at Microsoft didn't listen to Larry Tesler and have decided instead to mode us in, but c'est la vie.
So anyway, the pop-up is still being displayed, but it's being displayed on the desktop, which is not visible. Bringing it to the top isn't doing any good because it's already at the top of all the other windows on the desktop. If you click on the "Desktop" tile in the Start Screen, you should see your window.
Fixing this problem is going to take some work. Forcing a focus switch to the desktop mode is a horrible idea from a usability perspective, and I'm not sure it's even possible. A better solution would be to look into using Toast notifications instead, which can be done from a desktop application.

In WinRT how to create an application that is always visible?

With windows 8, is it possible to create an application that is always visible? For instance, in previous versions of windows, there is the task bar with quick launch icons. Can I create something similar to the quick launch icons that are always on the screen?
If you are referring to a Windows 8 Store app then the answer is no. You can have a live tile and toast notifications that provides updates to the user which may cause the user to launch your application.
A good article to read to understand how your Windows Store apps will run on Windows 8 go here to learn about Application lifecycle (Windows Store apps). This will explain the App execution state.
It is not possible in the RT version, but the same is possible in the desktop version. If you have a desktop app, you can pin it to the taskbar. But any Window store app cannot be pinned to the taskbar. What you can do instead is move the app to the beginning of your Home screen, so anytime you click the Windows button your app will be visible right in front.
Do you mean always visible in the Star Menu screen? If so, you can add tile updating functionality to your application. As long as the user has the application pinned to the Start Menu, he would see the updates. Check the link below for an introductory tutorial.
http://blogs.msdn.com/b/windowsappdev/archive/2012/04/16/creating-a-great-tile-experience-part-1.aspx
"Quick Launch" has a very specific meaning, which you may or may not have been referring to in your question.
Below is the Quick Launch bar in Windows 8 - essentially a toolbar pointing to a location in your %AppData% directory. Prior to Windows 7 it was available by default, but the ability to now pin items directly to the taskbar rather supersedes it. Here's how you can restore Quick Launch if you really want to :)
It's, of course, available only in the Desktop mode and not on the Modern UI, where pinning a tile is the best you can hope for, and it's all up to the user to pin it AND to determine where it shows up on their Start Screen.
Another option worth mentioning (although more like system tray than quick launch) is lock screen presence. If the user chooses so and your app supports that, he can add it to his lock screen:
either as a a badge (up to 7 apps)
or as a tile notification (single app only)
This is not a way for the user to quickly start your app (other answers have already covered these options) but a way to stay visible and keep your user informed.