← Back to team overview

openlp-core team mailing list archive

Re: [Merge] lp:~springermac/openlp/menubar-fix into lp:openlp

 

Review: Approve

Let's get this into the alpha and fix any further issues as they arise.

Diff comments:

> 
> === modified file 'openlp/core/ui/maindisplay.py'
> --- openlp/core/ui/maindisplay.py	2015-12-14 00:21:58 +0000
> +++ openlp/core/ui/maindisplay.py	2015-12-24 19:52:15 +0000
> @@ -154,15 +161,30 @@
>          # regressions on other platforms.
>          if is_macosx():
>              window_flags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Window
> -            # For primary screen ensure it stays above the OS X dock
> -            # and menu bar
> -            if self.screens.current['primary']:
> -                self.setWindowState(QtCore.Qt.WindowFullScreen)
> -            else:
> -                window_flags |= QtCore.Qt.WindowStaysOnTopHint
>          self.setWindowFlags(window_flags)
>          self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
>          self.set_transparency(False)
> +        if is_macosx():

Is there any way we could put this in a separate method?

> +            if self.is_live:
> +                # Get a pointer to the underlying NSView
> +                try:
> +                    nsview_pointer = self.winId().ascapsule()
> +                except:
> +                    nsview_pointer = voidptr(self.winId()).ascapsule()
> +                # Set PyCapsule name so pyobjc will accept it
> +                pythonapi.PyCapsule_SetName.restype = c_void_p
> +                pythonapi.PyCapsule_SetName.argtypes = [py_object, c_char_p]
> +                pythonapi.PyCapsule_SetName(nsview_pointer, c_char_p(b"objc.__object__"))
> +                # Covert the NSView pointer into a pyobjc NSView object
> +                self.pyobjc_nsview = objc_object(cobject=nsview_pointer)
> +                # Set the window level so that the MainDisplay is above the menu bar and dock
> +                self.pyobjc_nsview.window().setLevel_(NSMainMenuWindowLevel + 2)
> +                # Set the collection behavior so the window is visible when Mission Control is activated
> +                self.pyobjc_nsview.window().setCollectionBehavior_(NSWindowCollectionBehaviorManaged)
> +                if self.screens.current['primary']:
> +                    # Connect focusWindowChanged signal so we can change the window level when the display is not in
> +                    # focus on the primary screen
> +                    self.application.focusWindowChanged.connect(self.change_window_level)
>          if self.is_live:
>              Registry().register_function('live_display_hide', self.hide_display)
>              Registry().register_function('live_display_show', self.show_display)


-- 
https://code.launchpad.net/~springermac/openlp/menubar-fix/+merge/281345
Your team OpenLP Core is subscribed to branch lp:openlp.


References