clapper
clapper copied to clipboard
Can't get window manager context menu without using Super + RClick
Right clicking anywhere on the window pauses/plays the video, which was unexpected to me, but more importantly it means that it's not possible to show the window manager context menu, with actions such as "Always on Top".
Maybe we could have left click do play/pause instead, maybe with youtube-style osd feedback. Mst web video players do this, so I think it'd be quite natural to most people. Then we could open the window manager menu on right click anywhere on the video (since there's no visibly separate headerbar).
Hi, sorry for late response.
it's not possible to show the window manager context menu, with actions such as "Always on Top".
Well, there is no right click headerbar context menu as there is no headerbar. Reason is as simple as that. AFAIK, the right click context menu access comes as part of GTK internal headerbar API and it does not seem possible (to my knowledge) to freely access and place it within other widgets. To compensate, Clapper has a "PiP" button that makes player enter a special controls-less window that should automatically stay on top (this mode whole purpose). Another one that people might want, mainly "Always on visible workspace" can be controlled from prefs.
With this being in place, I never thought anyone would want an additional right click context menus as (at least to me) having a single button that does it all (together with window transition) seems much easier to use then button + additional work of opening and navigating through context menus.
This works well with GNOME Shell up to version 40, but since 41 gnome-shell devs decided to cut off apps access to such functionalities as what Clapper has been doing (a real pity). I have yet to find an alternative solution for making PiP button work again as its supposed to on latest gnome shell versions.
Well, there is no right click headerbar context menu as there is no headerbar.
GtkHeaderBar doesn't do anything more magical than including a GtkWindowHandle inside. That widget is public, it's easy to wrap the whole window into it.
Even if it didn't exist, bringing up context menu is as easy as calling a func on GdkToplevel - and then much bigger problems are having an x11 fallback menu and handling the settings correctly (which action to use for double/right/middle click). But GtkWindowHandle does it for you. Along with allowing to drag the window.
FWIW in GTK3 it wasn't private either - GtkHeaderBar didn't do anything with this at all, but it was instead tied to the GtkWindow titlebar area - and HdyWindowHandle allowed to decouple it. GtkWindowHandle is pretty much that, but upstreamed and the window titlebar area doesn't differ from the rest of the window at all wrt input.
Didn't know GtkWindowHandle was public API. I always assumed since its not a typical visible widget, it would be not. Using it would as you mentioned likely allow to have the right-click context menu easily implemented on the whole player area, but at the cost of removing toggle play/pause with right mouse button. :balance_scale:
As mentioned above, IMO left click would make more sense for that anyway. I'm not aware of any prior art for video players that do it on right click, but plenty of very popular ones using left click (or tap on touch).
left click would make more sense for that anyway. I'm not aware of any prior art for video players that do it on right click
Really? Is there even one that does this on left click?
- Totem - neither works
- mpv - right click to toggle pause
- Celluloid - right click to toggle pause
- VLC - right click opens context menu where first item is toggle pause
Not to mention that this would introduce problems that I mentioned earlier in https://github.com/Rafostar/clapper/issues/18 and break DVD menu navigation that also uses left click.
YouTube.
None of the players you have listed are examples of a good UI.
YouTube.
Clapper is a desktop/mobile video player, not a website. If possible I would rather prefer comparisons with other video players, not web browsers, where (in video players) as it happens, they also do it with right click by default. Having this set to something that users moving from other video players are already used to, seems like a natural choice.
None of the players you have listed are examples of a good UI.
I am not sure how this is related to which button does what :thinking:
I am not against changing stuff or adding more features, but not at expense of removing already present ones. I just cannot imagine how a single left button can do so much (and tell apart what user is trying to do). Like starting window drag from anywhere (without pausing), enter fullscreen with double click (without triggering pause in between), and handling DVD menu navigation.
The main problem here (as I understand) is that Wayland lacks a protocol for PiP windows (as mentioned here) and that GNOME Shell 41 removed the previous functionality that we have been taking advantage of to have our PiP window automatically stay on top (without needing context menu).
Clapper is a desktop/mobile video player, not a website
I don't think that matters here. A player is a player.
Like starting window drag from anywhere (without pausing),
Pause on release rather than click. GtkGestures can handle this just fine. :)
Fullscreen - you can do a timeout - YouTube handles this fine. That said, double click is handled by GtkWindowHandle so you may need to set capture phase in your gestures if they don't work with bubble.
handling DVD menu navigation.
Not super familiar with it - I don't have a dvd drive in my laptop and the desktop dvd players I've seen usually had a separate window with buttons for this, like a physical remote. How does it work in clapper?
Wayland lacks a protocol for PiP windows
Right. Someone needs to write it. :)
GNOME Shell 41 removed the previous functionality that we have been taking advantage of to have our PiP window automatically stay on top
Right - that's not API and there were never any guarantees it will keep working. Besides, it was GNOME Shell-speciifc anyway, you shouldn't have used it to begin with. 🤷️
Not super familiar with it - I don't have a dvd drive in my laptop and the desktop dvd players I've seen usually had a separate window with buttons for this, like a physical remote. How does it work in clapper?
Well, DVD displays colorful animated menu with various options. You hover over them with mouse. Hovered option "lights up" and you click/tap this option to select it. Courtesy of combining GstNavigationInterface with GtkEventControllers :smile: . I think Totem also does this similarly, but with GTK3. What would happen here after moving to pause on left click? BTW: GStreamer likes to crash if you try to seek or pause within DVD menu.
Right - that's not API and there were never any guarantees it will keep working.
I always thought that publicly exported DBus methods from GNOME Shell should have some level of stability. Due to the lack of Wayland proto, having PiP working on at least GNOME (until said proto is invented) seemed better then not working anywhere.
Well, DVD displays colorful animated menu with various options.
Well, that I know :) I was less sure if you can detect clicks on them or showed an OSD with arrows or sth.
Now, the question is: can you know if a click was used for navigation? If you can - I'd just do that and ignore pause in this case.
I always thought that publicly exported DBus methods from GNOME Shell should have some level of stability.
If it's not documented, it's not an API. There are plenty of private and debugging interfaces. What changed in 41 is that private interfaces now actually check what's using them and are only responding to the modules those interfaces were made for.
can you know if a click was used for navigation?
I do not think so. The video sink just sends those signals without a care in the world, while GStreamer makes use of them or discards them internally (if nothing handles them at a time). This makes this navigation in GStreamer more universal and besides DVD navigation might allow other things (haven't actually tried) like movement on 360 degrees videos, VR, etc. when a plugin for these is available/installed.
Can you point to the specific api you're using?
Looking closely at https://gstreamer.freedesktop.org/documentation/video/gstnavigation.html, the most likely solution would be to listen for the GST_NAVIGATION_MESSAGE_MOUSE_OVER messages on the bus and switch between pausing and selecting item with left click when mouse is over a clickable in-video button (that's how at least from what I understand this event indicates). But it would still unfortunately try to pause outside of clickable menu button.
But both this + trying to distinguish double clicks from single ones for fullscreen or pause, seems like quite a bit of additional logic. I was hoping, I will be able to actually reduce amount of code on the player UI side (especially after recent porting of youtube playback handling to separate lib) :disappointed:
This app isn't part of gnome circle or anything like that, so ATM I won't be giving any ETA on this :smile:
they also do it with right click by default
[citation needed], I only ever seen thinks like speed controls
it's not possible to show the window manager context menu, with actions such as "Always on Top".
As in other apps, Super + Right click anywhere on the window opens the context menu. So not being able to open it at all does not seem to be a problem here.
So right now users are able to drag the window, pause, enter/leave fullscreen without any sort of weird delays that may seems like UI is unresponsive or cause stutter with accidental pausing in between. Additionally toggle playback with right button (like other players do). And finally open the extra context menu with Super + RClick. Isn't that good enough?
Not to mention once Wayland gains said protocol (I hope soon) it will have a dedicated button that both alters player layout and automatically causes always on top app state.
You can also close the window with alt+f4. Not really a solution.
(I hope soon)
If you work on it, sure. Otherwise - very unlikely.
As in other apps, Super + Right click anywhere on the window opens the context menu
I don't think most people know this shortcut.
There is also alt + space.
Another temporal solution is to show the menu on middle click. On laptops it's three fingers tap.
Leaving a single comment here on both this issue and #18 since they are related. With pending UI re-implementation, Clapper will have:
- Toggle play/pause with left click
- Toggle fullscreen with double click
- Open context menu by right click anywhere on the window
I hope this fixes both issues, thus I am marking this and the issue about left click to be closed once current rework is finished and merged.
What will happen to DVD menus?
What will happen to DVD menus?
This will be work for when updating the sink (not part of current rewrite initiative, but will come next). The plan for that is:
- We send click event to upstream pipeline elements
- We get response that nobody handled it (there was no DVD menu)
- We pause at this point