nicklan / pnmixer

Volume mixer for the system tray

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Popup window overlaps panel [gtk2] [gtk3]

milos3 opened this issue · comments

It feels awkward having the popup window covering the panel. This affects both gtk2 and gtk3. I got around this by removing <property name="type">popup</property> from their xml files. Doing this does not give me any errors in the terminal for either gtk2 or gtk3.

the "popup" was introduced in order to not break things for tiling window managers
6c39f62

If popup is removed, then tiling window managers will show the window in the middle of the screen.

I'll have to see if I can make it work on my tiling wm without popup.

So, this is weird when I remove the popup property: only the very FIRST time I open up the popup it shows up at the mouse pointer position according to
<property name="window_position">mouse</property>
Every subsequent showing of the popup will ignore this property.

Yep, I agree with @milos3, the popup covering the panel is a little bit awkward. It's no big deal though, I mean, PNMixer is still usable. It just feels out of place a little bit.

Also, these errors show up on subsequent clicks on the tray icon (except the first one) when the popup property is gone:

(pnmixer:12069): Gdk-CRITICAL **: gdk_device_get_window_at_position_double: assertion 'GDK_IS_DEVICE (device)' failed

So something in hide_me seems to fail without that property.

edit: Yeah, ofc it fails, because the mouse pointer isn't inside the window anymore.

I bet we will improve that when GtkStatusIcon will be replaced by... something else (still mysterious to me)

This fixes the problem for me, i can do a PR if you like it.
Tested in fedora 26 with mate-desktop

From 8bd428979716fb7852bd06acf96d5ef27e52cd68 Mon Sep 17 00:00:00 2001
From: raveit65 <mate@raveit.de>
Date: Thu, 15 Feb 2018 15:40:17 +0100
Subject: [PATCH] popup: fix position and and change window hint

In result popup isn't on top of the panel.
Changing tye-hint makes sure that popup is always
above other windows.
---
 data/ui/popup-window-horizontal-gtk3.glade | 3 +--
 data/ui/popup-window-vertical-gtk3.glade   | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/data/ui/popup-window-horizontal-gtk3.glade b/data/ui/popup-window-horizontal-gtk3.glade
index 7e1c9c7..0cbefd9 100644
--- a/data/ui/popup-window-horizontal-gtk3.glade
+++ b/data/ui/popup-window-horizontal-gtk3.glade
@@ -9,10 +9,9 @@
   </object>
   <object class="GtkWindow" id="popup_window">
     <property name="can_focus">False</property>
-    <property name="type">popup</property>
     <property name="resizable">False</property>
     <property name="window_position">mouse</property>
-    <property name="type_hint">utility</property>
+    <property name="type_hint">dropdown-menu</property>
     <property name="skip_taskbar_hint">True</property>
     <property name="skip_pager_hint">True</property>
     <property name="decorated">False</property>
diff --git a/data/ui/popup-window-vertical-gtk3.glade b/data/ui/popup-window-vertical-gtk3.glade
index 5e77ff2..4088f32 100644
--- a/data/ui/popup-window-vertical-gtk3.glade
+++ b/data/ui/popup-window-vertical-gtk3.glade
@@ -9,10 +9,9 @@
   </object>
   <object class="GtkWindow" id="popup_window">
     <property name="can_focus">False</property>
-    <property name="type">popup</property>
     <property name="resizable">False</property>
     <property name="window_position">mouse</property>
-    <property name="type_hint">utility</property>
+    <property name="type_hint">dropdown-menu</property>
     <property name="skip_taskbar_hint">True</property>
     <property name="skip_pager_hint">True</property>
     <property name="decorated">False</property>
-- 
2.13.6

@milos3 any chance you could try this patch and see if it fixes the issue, as you're the one who primarily reported the problem ?

Just tried it with xfce and while it works, there is an issue that it is positioned behind notifications, making it unusable in that area.
notification

Because of the initial reason I also tried it in a tiling window manager (i3wm) and the patch didn't work for the default panel or other panels (xfce4-panel, tint2) - window still overlaps the panel and sometimes it even positions itself at the center of the screen.

Wow, great review, thx ! Well, I think we won't apply this patch then :/

I hope this is not committed downstream in fedora.

I've skimmed through the options again and I think our choice of GtkWindowType (popup) and GdkWindowTypeHint (utility) are pretty much accurate.

I don't see a way to solve this, except by enhancing gtk+ functionality, which is out of scope. As such, I guess this is kind of "can't fix" or "won't fix".

Suggested course of action:

  • add this issue to the list of "known bugs" in the Readme
  • close this issue and add cantfix/wontfix label

Hmm, looks like it was a mistake to take over ownership in fedora for pnmixer.

  • no pulseaudio support, (unmute doesn't work)
  • this weird behaviour here.

With all this problems i have no chance to use it for MATE Desktop in fedora.
My idea to use it with pavucontrol as mixer frontend won't work.
So, I don't see any reason to spend my rare time for it.
I will make it obsolete, maybe another maintainer will jump in.......

no pulseaudio support, (unmute doesn't work)

Exactly, as any alsa mixer has this problem.

You should be familiar with the technology stack of the packages/environment you maintain if you make choices for a wide range of users.

The lack of PulseAudio support is also clearly documented in https://github.com/nicklan/pnmixer#about

I will add a specific note about it https://github.com/nicklan/pnmixer#known-bugsglitches here too, so it's really clear to everyone that there are problems with PulseAudio.

You should be familiar with the technology stack of the packages/environment you maintain if you make choices for a wide range of users.

Exactly, it was a mistake by me to take ownership of it in fedora
I will revert this ;-)

PNMixer works fine for Alsa systems. I don't think it should be default on Fedora MATE, but I'd say it's one of the more popular alsa mixers out there, so having a properly maintained package makes sense IMO.

Fedora use pulseaudio as default since a long time for all desktops.
Believe me, it is an ugly hack to prevent pulseaudio to start in all desktops in fedora.
Only a few users in fedora, who builds their system for their own will have a benefit from an alsa-only mixer.