plasma-applet-active-window-control icon indicating copy to clipboard operation
plasma-applet-active-window-control copied to clipboard

Integrate or add a button for the new global menu feature of Plasma 5.9

Open lboklin opened this issue 8 years ago • 29 comments

If possible, try and add the functionality of the existing global menu widget shipped with Plasma 5.9 in KDE Neon and probably most other up-to-date KDE distributions. Preferably make it use the icon used for the global menu when placed in the title bar (as opposed to in a panel widget) for consistency.

Even better if a more refined version could be added that works like the global menu bar in Unity, where it expands / replaces the window title upon hovering the pointer over it.

lboklin avatar Feb 09 '17 09:02 lboklin

That would be cool, indeed!

kupiqu avatar Feb 12 '17 15:02 kupiqu

First and experimental version of this is now added to master. You need to enable it in settings. Please try and report issues:).

NOTE: there need to be only one applet showing global menu, otherwise one of them will crash plasmashell when its menu is clicked.

Known issues I will address:

  • shrink menu buttons if they don't fit available space
  • automatic width of widget when menu don't fit available space

kotelnik avatar Feb 15 '17 22:02 kotelnik

Neat!

kupiqu avatar Feb 15 '17 23:02 kupiqu

It's working good for being experimental :)

My main issue right now is that buttons overlay the title, could them be set at title's right side?

is this perhaps happening to me because the close/maximize/minimize button are on the left in my configuration (and they appear only for maximized windows)?

kupiqu avatar Feb 15 '17 23:02 kupiqu

Or even to give the option to remove the title on hovering, perhaps?

kupiqu avatar Feb 15 '17 23:02 kupiqu

Another (but rather minor thing for now) is that it seems there is a bit of vertical misalignment between title and button labels

To this regard, could button labels being vertically centered within the button? That may fix the issue...

kupiqu avatar Feb 15 '17 23:02 kupiqu

Other than these relatively minor issues, I'm pretty impressed on how sharply it behaves!!

kupiqu avatar Feb 15 '17 23:02 kupiqu

Another issue I'm having is that menubar buttons also overlay the close/maximize/minimize buttons (they appear only for maximized windows)

As I use this together with no title bar and border on maximized windows, now I don't have a way to exit from maximized status.

kupiqu avatar Feb 16 '17 19:02 kupiqu

Thanks a lot for your feedback. That's exactly what I was hoping for :). I tried to mitigate almost all the problems you mentioned.

  • overlaying title is now optional (checkbox: Show next to icon and text)
    • although when checked, global menu is between buttons and window title (I thought it makes more sence since menu is always on the same spot and window title can be really long)
  • remove the title on hovering: this was by default, or am I missing something?
  • misalignment between title and button labels (checkbox: Fill height) - I believe this checkbox is just for that. Otherwise this is intentional. I have a quite thick upper panel where window buttons are upper left and global menu buttons are bottom left.
  • vertically centered button labels: They should be centered by definition of the widget used, but I can see when panel is thinner, they just don't fit. I now tried to fix that by scaling down the button label font but it worked only partially...
  • menubar buttons also overlay the close/maximize/minimize buttons - try checkbox "Show next to buttons"
  • a way to exit from maximized status: other then using "Show next to buttons", you can also make use of mouse wheel settings (scroll down to unmaximize)

Again thanks a lot and keep spamming me with these ideas as you see fit! :)

kotelnik avatar Feb 19 '17 16:02 kotelnik

Can't believe this was even possible! Now officially my #1 plasma widget :-) Actually does what the global menu does better on my install. And that's on top of the core functions. Outstanding!

MattMcHackit avatar Feb 19 '17 20:02 MattMcHackit

screenshot_20170219_205926-1 Could the spacing between the global menu and the application icon be increased when 'Show next to icon and text' is set, please? Or made user configurable? Thank you!

MattMcHackit avatar Feb 19 '17 21:02 MattMcHackit

remove the title on hovering: this was by default, or am I missing something?

I can see it below, could you check this in the dark breeze plasma theme, please?

misalignment between title and button labels (checkbox: Fill height) - I believe this checkbox is just for that. Otherwise this is intentional. I have a quite thick upper panel where window buttons are upper left and global menu buttons are bottom left. vertically centered button labels: They should be centered by definition of the widget used, but I can see when panel is thinner, they just don't fit. I now tried to fix that by scaling down the button label font but it worked only partially...

yes, I think this is what is happening... (my latte-dock panel is 32 px icon size). I wonder, isn't there a way to make buttons' frames invisible with no margin? that would look more minimalistic and labels would fit height even for that thin panels.

menubar buttons also overlay the close/maximize/minimize buttons - try checkbox "Show next to buttons"

Could you please add the slicing behavior of buttons for the app menu too? I like the feature (for only showing buttons on maximized windows) but if it does not apply to the app menu, there is not much of a point...

Thanks!

kupiqu avatar Feb 20 '17 04:02 kupiqu

For the case I was not clear in my first point above, the window title fades a bit but is perfectly visible behind the app menu buttons in my system.

I double checked, and this happens for breeze and dark breeze plasma themes, as well as in latte dock and regular plasma panels.

Using KDE neon (plasma) 5.9.2

EDIT:

I found that this is because of opacity is set to 0.2 in main.qml, line 225:

opacity: appmenu.visible && !appmenuNextToIconAndText ? 0.2 : 1 Setting it to 0, fixes the issue

kupiqu avatar Feb 21 '17 04:02 kupiqu

In Kubuntu 17.04(KDE 5.9) there is no export(option) for global menu for "Active Window Control". I have only "Application Menu widget" option. Do you know how to fix it?

backtozero avatar Apr 24 '17 17:04 backtozero

It doesn't show up in Arch either. Plasma 5.9.5.

Thomqa avatar May 11 '17 21:05 Thomqa

That is #1 in my wish list after migrating from unity. I thought with "customasibility" of KDE/Plasma it should be easy. But it's pretty annoying to using both Global Menu widget and this one.

backtozero avatar May 11 '17 21:05 backtozero

You just have to export to Application Menu widget and then add Active Window Control widget.

Once done, go to settings (of the Active Window Control widget) and enable the Application Menu.

EDIT: I actually think this issue should be closed, as IMO it's implemented

kupiqu avatar May 11 '17 21:05 kupiqu

@kupiqu i did few times either on laptop and pc. It works for Application Menu widget but not for Active Window Control.

Is that possible that having both of them simultainiously causes some problems?

Is there any easy way to troubleshoot? I am new in kde. Maybe some ways to enable debug logging or something?

backtozero avatar May 11 '17 22:05 backtozero

Yes, I think it cannot be exported twice...

kupiqu avatar May 11 '17 22:05 kupiqu

@kupiqu

Just right now:

  1. i have removed Application Menu widget
  2. Rebooted my laptop(to be clear)
  3. Checked that Application Menu is enabled in ActiveWC settings
  4. No luck. There is nothing like Application Menu widget near "close" and other buttons of AWC.

Also playing with many other options of AWC gives nothing.

backtozero avatar May 11 '17 22:05 backtozero

How did you install the widget?

If that's not the case, what if you try to compile from master?

kupiqu avatar May 11 '17 22:05 kupiqu

@Thomqa , @backtozero : Hi! I have Arch and it's working there for sure. Yes, it is important that you have only one widget which supports application menu on your desktop. Steps to narrow down the issue are here: https://github.com/kotelnik/plasma-applet-active-window-control/issues/61#issuecomment-299053327

kotelnik avatar May 12 '17 04:05 kotelnik

@kotelnik

  1. Tried [https://github.com/kotelnik/plasma-applet-active-window-control/issues/61#issuecomment-299053327] on kde store version. Didn't worked.

  2. compiled from master. I can see big progress about total consistency, thank you! But it also does nothing with global menu. Then I have tried killall plasmashell && plasmashell And there is some log output that i asssumed can be related to this problem.

qml: initializing appMenuModel... qml: appMenuModel failed to initialize: Error: Qt.createQmlObject(): failed to create object: file:///usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/ui/inline:1:89: module "org.kde.private.activeWindowControl" is not installed qml: initializing appmenu...DONE null file:///usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/ui/AppMenu.qml:49:9: QML Connections: Cannot assign to non-existent property "onRequestActivateIndex" file:///usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/ui/main.qml:249:13: QML Text: Binding loop detected for property "computedWidth" Trying to use rootObject before initialization is completed, whilst using setInitializationDelayed. Forcing completion

backtozero avatar May 12 '17 13:05 backtozero

ad 1) Indeed, KDE store version does not support global menu. I cannot have C++ plugin code (meaning it does not contain "org.kde.private.activeWindowControl" module. ad 2) log line:

module "org.kde.private.activeWindowControl" is not installed

...means you still have KDE store version of widget installed. You need to remove it so you end up with only the compiled widget.

kotelnik avatar May 12 '17 13:05 kotelnik

@kotelnik I have no ".local/share/plasmoids" but ".local/share/plasma/plasmoids". And its empty. Also lsof shows nothing. A can try to find the exact file with strace plasmashell, but i dont know what to "grep".

UPD It was there before. I have made locate org.kde.activeWindowControl and it shows me old index data: /home/user/.local/share/plasma/plasmoids/org.kde.activeWindowControl

UPD2 It says:

file:///usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/ui/inline:1:89: module "org.kde.private.activeWindowControl" is not installed

But there is no file /usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/ui/inline

backtozero avatar May 12 '17 14:05 backtozero

Sorry, it should have been indeed ".local/share/plasma/plasmoids", I've fixed the comment now, thanks!

Then I think, there was a problem in installing the plugin part of the widget. Please tell me what distribution do you have and what commands did you use for installing from source? I use these:

git clone https://github.com/kotelnik/plasma-applet-active-window-control
cd plasma-applet-active-window-control
./install.sh

kotelnik avatar May 12 '17 15:05 kotelnik

@kotelnik Kubuntu 17.04.

It works now! I have made mistake by trying to build some(ECM modules) dependencies from master(git clone git://anongit.kde.org/extra-cmake-modules and so on).

I delete everything, and install all missing files by finding them in the OS repository. Like so: "apt-file search Qt5X11ExtrasConfig.cmake". There should be some meta-package that includes all dev packages for building kde apps, but i am new in kde.

Anyway thank you very much!

backtozero avatar May 12 '17 16:05 backtozero

It would be very nice if somebody made PPA repository for kubuntu with your widget. I could, but i have no such experience.

Next big step for you is to make GTK apps working too. It already shows menu(File| Edit|View)... in firefox for example, but sub-menus doesn't show up.

Thank you for your job!

backtozero avatar May 12 '17 16:05 backtozero

@kotelnik Tried to reproduce on my laptop. And i have got errors again. Don't understand.

qml: initializing appMenuModel... qml: appMenuModel failed to initialize: Error: Qt.createQmlObject(): failed to create object: file:///usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/ui/inline:1:89: module "org.kde.private.activeWindowControl" is not installed qml: initializing appmenu...DONE null file:///usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/ui/AppMenu.qml:49:9: QML Connections: Cannot assign to non-existent property "onRequestActivateIndex" Trying to use rootObject before initialization is completed, whilst using setInitializationDelayed. Forcing completion Loading Calendar plugin HolidaysEventsPlugin(0x55c1ba5a56d0) Both point size and pixel size set. Using pixel size. Both point size and pixel size set. Using pixel size. Both point size and pixel size set. Using pixel size. file:///usr/share/plasma/plasmoids/org.kde.activeWindowControl/contents/ui/main.qml:249:13: QML Text: Binding loop detected for property "computedWidth" file:///usr/lib/x86_64-linux-gnu/qt5/qml/QtQuick/Controls/Button.qml:99: TypeError: Cannot read property of null

backtozero avatar May 12 '17 20:05 backtozero