Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add FullScreen property to mpris2

  • Loading branch information...
commit 79d21079efebe604bffa5f4135a1453172ea3eac 1 parent b1482ff
@squentin authored
Showing with 13 additions and 0 deletions.
  1. +4 −0 gmusicbrowser.pl
  2. +9 −0 plugins/mpris2.pm
View
4 gmusicbrowser.pl
@@ -3092,6 +3092,9 @@ sub OpenSpecialWindow
Layout::Window->new($layout, ifexist => $ifexist, uniqueid=>$type);
}
+sub SetFullScreenMode
+{ ToggleFullscreenLayout() if $_[0] xor $FullscreenWindow;
+}
sub ToggleFullscreenLayout
{ if ($FullscreenWindow)
{ $FullscreenWindow->close_window;
@@ -3117,6 +3120,7 @@ sub ToggleFullscreenLayout
$FullscreenWindow->signal_connect(destroy => sub { UnWatch($h,'Playing'); $h->{destroy}=1; &$sub(); });
}
}
+ HasChanged('FullScreen',!!$FullscreenWindow);
}
sub WEditList
View
9 plugins/mpris2.pm
@@ -102,6 +102,7 @@ sub new
my $self = $class->SUPER::new($service, '/org/mpris/MediaPlayer2');
bless $self, $class;
::Watch($self, Seek => \&Seeked);
+ ::Watch($self, FullScreen=> sub { $self->emit_signal( PropertiesChanged => 'org.mpris.MediaPlayer2', {Fullscreen=> Fullscreen()} ,[] ); });
#watchers for properties of org.mpris.MediaPlayer2.Player that send PropertiesChanged signal
my %events;
@@ -140,6 +141,14 @@ sub Quit
{ ::Quit();
}
+dbus_property('Fullscreen', 'bool', 'readwrite');
+sub Fullscreen
+{ if (defined $_[1]) { ::SetFullScreenMode($_[1]); }
+ else { return dbus_boolean(!!$::FullscreenWindow) }
+}
+dbus_property('CanSetFullscreen', 'bool', 'read');
+sub CanSetFullscreen {dbus_boolean(1)}
+
dbus_property('CanQuit', 'bool', 'read');
sub CanQuit {dbus_boolean(1)}
dbus_property('CanRaise', 'bool', 'read');
Please sign in to comment.
Something went wrong with that request. Please try again.