Cannot restore OpenLP after minimising on OSX

Bug #1247661 reported by Phill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Status tracked in Trunk
2.0
Fix Released
Medium
matysek
Trunk
Fix Released
Medium
Jonathan Springer

Bug Description

Using OSX 10.6.8 and OpenLP 2.0.3
Make sure the main display is showing
Minimise the OpenLP gui and the main display remains
Click on OpenLP in the doc to maximise it and it doesn't do anything.

Click on the main display and press escape to close it.
Click on OpenLP on the doc to maximise it and it maximises

This issue also affects OpenSong

Tags: gui osx

Related branches

Phill (phill-ridout)
tags: added: gui osx
Revision history for this message
Phill (phill-ridout) wrote :

We're using OSX 10.6.8 at church and this affects us.

Revision history for this message
Phill (phill-ridout) wrote :

Just noticed that this affects Ubuntu too.

Open OpenLP and send an item live.
Minimise the operators screen now click the OpenLP icon in the Unity Launcer and the operators gui does not maximise
Also if you minimise the operators gui and switch to annother application you cannot alt tab back.

Hoewver, hover over the OpenLP icon in the launcher and use the scroll wheel to bring the GUI back (this is usually used to show multiple instances od the same application)
You can also right click and select "OpenLP 2.0"

Finally if you hold down alt and repeatedly press tab untill the OpenLP icon is selected and then wait whils holding alt both windows appear and you can then use tab to swithch to the operators gui

Revision history for this message
Phill (phill-ridout) wrote :

After further investigations setting "Bypass x11 window manager" changes ubuntu's behaviour to what I would call working. Havn't a clue if this makes a difference on mac?

Revision history for this message
Phill (phill-ridout) wrote :

QtCore.Qt.SplashScreen set as a flag also fixes this (with out the bypass x11 window manager)

Revision history for this message
matysek (mzibricky) wrote :

This issue also affects OSX 10.7.5 - running openlp of source.

It look like clicking on the OSX Dock does nothing.

I think we have to handle click on the Dock and maximize the main window.

The implementation issue is how to detect click in the Dock.

Revision history for this message
matysek (mzibricky) wrote :
Revision history for this message
Phill (phill-ridout) wrote :
Revision history for this message
matysek (mzibricky) wrote :

I tried your fix but it does not fix this issue for osx.

Revision history for this message
Phill (phill-ridout) wrote :

I'm not actually sure if this is a bug or not. Maybe its because I'm new to OSX?

I noticed today that when I minimised the GUI that it minimised to an icon on the right of the doc as described at http://support.apple.com/kb/ht2474 :

"The Dock keeps applications on its left side, while Stacks and minimized windows are kept on its right. If you look closely, you'll see a vertical separator line that separates them. If you want to rearrange where the icons appear within their line limits, just drag a docked icon to another location on the Dock and drop it."

Click on the minimised icon and the GUI is restored. This seems to work well when you have multiple documents open, but no so much when using an application like OpenLP. I have been unable to check how other "single instance" applications handle this.

Perhaps this has something to do with OSX's "window-per-document model" as described at: http://arstechnica.com/information-technology/2009/01/dock-and-windows-7-taskbar/

Revision history for this message
matysek (mzibricky) wrote :

Usual OSX behavior:
- it looks like there is created a minimized icon for every window.
- click on the minimized icon restores the window
- if all windows were minimized - click on the app icon restores the last minimized window of the app
- one window still active (not minimized) - click on the app icon brings the active window in front above other windows of other apps

OpenLP wrong behavior:
- click on the app icon does nothing

What should be fixed:
- click on the app icon in the Dock should restore the window with OpenLP

Idea (I think):
- when openlp window is minimized then the window with presentation screen is still active
- I think click on the OpenLP app icon is actually bringing the presentation screen above other windows
  - and the main window is then still kept minimized because presentation screen was activated

Idea Verification:
1) minimize first the presentation screen window (probably start programatically as minimized) and then the main window
2) click on the openlp app icon

Conclusion:
- If the main window will display after clicking on the app icon then openlp handles the presentation screen badly.

Revision history for this message
matysek (mzibricky) wrote :

What I did:
1) I tried to start openlp with presentation screen minimized. I added the following line to the __init__() of MainDisplay class:

  self.setWindowState(QtCore.Qt.WindowMinimized)

2) start openlp and minimize the main window - both windows were minimized
  - two minimized icons were created at the right side of the dock
3) click on the openlp app icon
  - white window is maximized on the 2nd screen
  - two minimized icons are still there and none of the is restored

I think to fix it we should experiment with various window flags:

http://qt-project.org/doc/qt-4.8/qt.html

Revision history for this message
matysek (mzibricky) wrote :

When OpenLP main window is minimized then the window with presentation gets the keyboard and mouse focus.
If clicking on the app icon in the dock then OSX will just return the keyboard and mouse focus to the presentation window.

The fix could be to somehow deactivate the presentation window or leave the mouse/keyboard focus for other OSX apps when openlp main window is minimized.

Are there any suggestions how this could be implemented?

Revision history for this message
matysek (mzibricky) wrote :

I also found out that when you minimize openlp main window then the menu bar changes and only item "Python" is there. Shouldn't be the menubar the same even when the presentation window is active?

Revision history for this message
matysek (mzibricky) wrote :

Another attempt to fix this could be:
- let's suppose that click on the openlp dock icon makes openlp active (openlp has mouse and keyboard focus)
- Qt sends signal "openlp is active for the user"
- opelp catches this signal
- if the main window was minimized then openlp would just restore it (unminimize it)

Revision history for this message
matysek (mzibricky) wrote :

I think this bug could be fixed with the following signal and methods:

QApplication::focusChanged()

QWidget::setFocus(), QWidget::clearFocus(),

link: http://qt-project.org/doc/qt-4.8/qapplication.html#focusChanged

Revision history for this message
matysek (mzibricky) wrote :

I found a workaround:
- detect event QEvent::ApplicationActivate - user used another app and switched back to use openlp
- if the main window is minimized then it would be restored

Revision history for this message
Tim Bentley (trb143) wrote :

Is this fixed?

Revision history for this message
Tomas Groth (tomasgroth) wrote :

I'm assuming this has been fixed. Re-open if not.

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

I can't reproduce this on my mac currently (I don't have a second screen at the moment), but one thing I did notice was that if I have the display screen showing, then the minimize button is disabled.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.