D11075: Make Okular show the list of opened windows in the Dock menu

2018-12-01 Thread Sergio Bragin
sbragin abandoned this revision.
Herald edited subscribers, added: okular-devel; removed: Okular.

REPOSITORY
  R223 Okular

REVISION DETAIL
  https://phabricator.kde.org/D11075

To: sbragin, rjvbb
Cc: okular-devel, rjvbb, ngraham, darcyshen, aacid, #okular


D11075: Make Okular show the list of opened windows in the Dock menu

2018-03-07 Thread René J . V . Bertin
rjvbb added a comment.


  Qt Assistant also rolls its own Window (sans s...) menu.
  
  Let's forget the discussion about a Window menu for now. I still don't 
understand how come there is no such menu but managing it isn't trivial, in 
large part because the standard/automatic version works with toplevel windows 
(NSWindows) and Qt applications tend to use tabs or MdiSubWindows instead.

REPOSITORY
  R223 Okular

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D11075

To: sbragin, rjvbb
Cc: rjvbb, #okular, michaelweghorn, ngraham, aacid


D11075: Make Okular show the list of opened windows in the Dock menu

2018-03-06 Thread Sergio Bragin
sbragin added a comment.


  In D11075#220228 , @rjvbb wrote:
  
  > Qt4 apps used to create a temporary NIB file in $TMPDIR and load that. I 
cannot recall having seen something similar in Qt5 and cannot find any evidence 
of it in the code. But just as with Info.plists there might be a way to create 
the information normally read from a nib/xib file purely in memory.
  
  
  Right. QtCreator, by the way, keeps track of opened windows internally and 
also uses setAsDockMenu(QMenu *).
  
  > Interesting. I'm pretty certain that entries in the Windows menu are 
ordered chronologically, at least in those applications where they get a 
shortcut. (I've never checked if that's always the case.).
  
  Probably, it has been changed in later versions. For me they are in 
alphabetical order.

REPOSITORY
  R223 Okular

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D11075

To: sbragin, rjvbb
Cc: rjvbb, #okular, michaelweghorn, ngraham, aacid


D11075: Make Okular show the list of opened windows in the Dock menu

2018-03-06 Thread René J . V . Bertin
rjvbb added a comment.


  > Actually, I do not know, whether there is an API that allows to force Mac 
OS to create such list in the Dock menu, but if an app implements "Window" menu 
(systemMenu="window" in the menu xib file), then this list is generated 
automatically.
  
  It's been too long since I did native Mac GUI app development from scratch, 
so I'll take your word for this =)
  
  > Do you happen to know whether it would be possible to do from Qt?
  
  Qt4 apps used to create a temporary NIB file in $TMPDIR and load that. I 
cannot recall having seen something similar in Qt5 and cannot find any evidence 
of it in the code. But just as with Info.plists there might be a way to create 
the information normally read from a nib/xib file purely in memory.
  
  >   Shall I consider this as a feature request? I personally do not use it.
  
  This is not something that should be implemented in individual applications. 
I was planning to ask on the Qt ML about implementing such a feature. If Qt 
doesn't have anything suitable for tracking window creation a logical place 
would be KWindowSystem (which already has some code for tracking window 
creation), and maybe the management of the Windows menu could be implemented in 
a platform integration plugin.
  
  I do see there's a Qt systemMenu() equivalent for QMdiSubWindows.
  
  >   They are sorted for Cocoa apps.
  
  Interesting. I'm pretty certain that entries in the Windows menu are ordered 
chronologically, at least in those applications where they get a shortcut. 
(I've never checked if that's always the case.).

REPOSITORY
  R223 Okular

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D11075

To: sbragin, rjvbb
Cc: rjvbb, #okular, michaelweghorn, ngraham, aacid


D11075: Make Okular show the list of opened windows in the Dock menu

2018-03-06 Thread Sergio Bragin
sbragin added a comment.


  In D11075#219937 , @rjvbb wrote:
  
  > I'm not sure if all Mac applications always show the open documents under 
their Dock tile (that menu can be used for anything, of course),
  
  
  Not all of them (shall I reword the commit message?). Actually, I do not 
know, whether there is an API that allows to force Mac OS to create such list 
in the Dock menu, but if an app implements "Window" menu (systemMenu="window" 
in the menu xib file), then this list is generated automatically. Do you happen 
to know whether it would be possible to do from Qt?
  
  > and I also think that it would be more useful to have a Windows menu like 
(most) native Mac apps have.
  
  Shall I consider this as a feature request? I personally do not use it.
  
  > Should the list be sorted btw (read: is that what Mac apps do)?
  
  They are sorted for Cocoa apps. And I do not see an easy way to have them in 
the last-opened/last-used order. Widgets are stored in a set inside 
QApplication, so, it is good to have some sorting.

REPOSITORY
  R223 Okular

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D11075

To: sbragin, rjvbb
Cc: rjvbb, #okular, michaelweghorn, ngraham, aacid


D11075: Make Okular show the list of opened windows in the Dock menu

2018-03-06 Thread René J . V . Bertin
rjvbb accepted this revision.
rjvbb added a comment.
This revision is now accepted and ready to land.


  I'm not sure if all Mac applications always show the open documents under 
their Dock tile (that menu can be used for anything, of course), and I also 
think that it would be more useful to have a Windows menu like (most) native 
Mac apps have.
  Other than that, LGTM.
  
  Should the list be sorted btw (read: is that what Mac apps do)?

REPOSITORY
  R223 Okular

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D11075

To: sbragin, rjvbb
Cc: rjvbb, #okular, michaelweghorn, ngraham, aacid


D11075: Make Okular show the list of opened windows in the Dock menu

2018-03-05 Thread Sergio Bragin
sbragin added a dependency: D11074: Fix opening files via a file manager on Mac.

REPOSITORY
  R223 Okular

REVISION DETAIL
  https://phabricator.kde.org/D11075

To: sbragin
Cc: rjvbb, #okular, michaelweghorn, ngraham, aacid


D11075: Make Okular show the list of opened windows in the Dock menu

2018-03-05 Thread Sergio Bragin
sbragin created this revision.
Restricted Application added a project: Okular.
sbragin requested review of this revision.

REVISION SUMMARY
  Qt applications, running on Mac, do not show the list of opened windows in 
the 
  Dock menu. This patch fixes it by creating a custom menu with the list and 
  inserting it as the Dock menu.

REPOSITORY
  R223 Okular

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D11075

AFFECTED FILES
  shell/macapplication.cpp
  shell/macapplication.h

To: sbragin
Cc: rjvbb, #okular, michaelweghorn, ngraham, aacid