kotelnik / plasma-applet-active-window-control

Plasma 5 applet for controlling currently active window.
GNU General Public License v2.0
119 stars 18 forks source link

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

Open lboklin opened 7 years ago

lboklin commented 7 years ago

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.

kupiqu commented 7 years ago

That would be cool, indeed!

kotelnik commented 7 years ago

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:

kupiqu commented 7 years ago

Neat!

kupiqu commented 7 years ago

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 commented 7 years ago

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

kupiqu commented 7 years ago

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 commented 7 years ago

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

kupiqu commented 7 years ago

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.

kotelnik commented 7 years ago

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

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

MattMcHackit commented 7 years ago

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 commented 7 years ago

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!

kupiqu commented 7 years ago

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 commented 7 years ago

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

backtozero commented 7 years ago

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?

Thomqa commented 7 years ago

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

backtozero commented 7 years ago

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.

kupiqu commented 7 years ago

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

backtozero commented 7 years ago

@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?

kupiqu commented 7 years ago

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

backtozero commented 7 years ago

@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.

kupiqu commented 7 years ago

How did you install the widget?

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

kotelnik commented 7 years ago

@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

backtozero commented 7 years ago

@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

kotelnik commented 7 years ago

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.

backtozero commented 7 years ago

@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

kotelnik commented 7 years ago

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
backtozero commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

@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