Skip to content

Commit

Permalink
Make double clicking to toggle fullscreen work under Wayland
Browse files Browse the repository at this point in the history
The 'fullscreen' property is not available when using opengl-cb.
Temporarily work around this by hard coding the binding and use GAction
to toggle fullscreen. A more permanent solution would be to allow
GActions to be activated from an input command.
  • Loading branch information
gnome-mpv committed Feb 6, 2016
1 parent 9fd87c2 commit 06adf7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/def.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"UP no-osd seek 60",\
"DOWN no-osd seek -60",\
"Q quit_watch_later",\
"MOUSE_BTN0_DBL cycle fullscreen",\
"MOUSE_BTN2 cycle pause",\
NULL }

Expand Down
9 changes: 9 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,15 @@ static gboolean mouse_press_handler( GtkWidget *widget,
{
mpv_command_string(ctx->mpv_ctx, command);
}
else if(btn_event->button == 1 && btn_event->type == GDK_2BUTTON_PRESS)
{
GAction *action;

action = g_action_map_lookup_action
(G_ACTION_MAP(ctx->app), "fullscreen");

g_action_activate(action, NULL);
}

return TRUE;
}
Expand Down

0 comments on commit 06adf7e

Please sign in to comment.