GNOME Bugzilla – Bug 614836
[PATCH] Clickthrough plugin
Last modified: 2018-05-24 10:37:57 UTC
These patches add a clickthrough plugin to Totem. The clickthrough plugin allows the totem window to be translucent and clickthroughable, when playing with the controls hidden - nice for viewing while working.
Created attachment 157917 [details] [review] Allow-the-controls-visible-setting-to-be-queried.patch
Created attachment 157918 [details] [review] Initial-clickthrough-plugin.patch
I'll need to test this a bit more thoroughly, but I would think that the plugin should be completely hidden, and enabled by default when compositing is available.
*** Bug 605750 has been marked as a duplicate of this bug. ***
I've now tested this for a few days, and found that the plugin should also listen for the events show-hide controls and fullscreen toggle, as currently you can get into some weird situations where the window is fullscreen and translucent. I'll try to work on a revised version. What should the plugin do if compositing is not available? Nothing is my guess, but it could still set the window on top and sticky...
(In reply to comment #5) > I've now tested this for a few days, and found that the plugin should also > listen for the events show-hide controls and fullscreen toggle, as currently > you can get into some weird situations where the window is fullscreen and > translucent. I'll try to work on a revised version. Cool, and make sure you fix the indentation and FIXMEs while you're at it :) > What should the plugin do if compositing is not available? Nothing is my guess, > but it could still set the window on top and sticky... Nothing, we already have an "Always on Top" plugin that'll only show the player on top when actually playing.
Comment on attachment 157917 [details] [review] Allow-the-controls-visible-setting-to-be-queried.patch That shouldn't be needed anymore.
Review of attachment 157918 [details] [review]: The UI has changed quite a bit, so this doesn't really apply any more. I would do pretty much the same thing, but: - only when playback is on-going - the player section of the UI is shown - and leave a hole in the clickthrough for the headerbar, so that the window is made 100% opaque when focused ::: src/plugins/clickthrough/totem-clickthrough.c @@ +76,3 @@ + +G_MODULE_EXPORT GType register_totem_plugin (GTypeModule *module); +GType totem_clickthrough_plugin_get_type (void) G_GNUC_CONST; Try to keep things indented. @@ +106,3 @@ + TotemClickthroughPluginPrivate *priv = pi->priv; + + bacon_video_widget_get_metadata (priv->bvw, BVW_INFO_HAS_VIDEO, &has_video); Checking whether there is a video isn't needed anymore, you can assume we're always playing video now. @@ +108,3 @@ + bacon_video_widget_get_metadata (priv->bvw, BVW_INFO_HAS_VIDEO, &has_video); + + gboolean toret = ( totem_is_playing (priv->totem) != FALSE && Don't declare variables inside the function, but at the top of the block/functon. @@ +131,3 @@ + if (flag) { + gtk_window_set_opacity (priv->window, WINDOW_MIN_OPACITY); + } } else { not: } else { @@ +163,3 @@ + } + + if (GTK_WIDGET_REALIZED (window)) reverse the condition and exit early, that will avoid most of the indentation afterwards. @@ +193,3 @@ + cairo_t* cr = NULL; + + gtk_widget_input_shape_combine_mask (window, My screen is wide, put all this on the same line. @@ +197,3 @@ + 0, + 0); + if (value) brace on the same line. @@ +231,3 @@ + TotemClickthroughPluginPrivate *priv = pi->priv; + + if ( is_playing_without_controls (pi) ) { Don't put space after opening parenthesis, or before closing ones, so: if (is_playing_without_controls (pi)) { @@ +236,3 @@ + + /* poll for mouse-over, to fade */ + // FIXME: read out current mouse-pointer position every 1/25 second I'm not sure that's really necessary, at least not at first. @@ +237,3 @@ + /* poll for mouse-over, to fade */ + // FIXME: read out current mouse-pointer position every 1/25 second + priv->pointer_update_id = g_timeout_add (1000/FPS, Indentation.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/totem/issues/40.