clutter: Remove stage fullscreening

Another unneeded feature related to clutter originally being an
application library that we have no use for when we're only ever a
compositor.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/616
This commit is contained in:
Jonas Ådahl
2019-06-08 17:06:13 +02:00
committed by Georges Basile Stavracas Neto
parent 4064d9a7a7
commit a61d525111
14 changed files with 41 additions and 632 deletions

View File

@ -2,7 +2,7 @@
#include <clutter/clutter.h>
#include <string.h>
gboolean IsFullScreen = FALSE, IsMotion = TRUE;
gboolean IsMotion = TRUE;
int
test_events_main (int argc, char *argv[]);
@ -114,28 +114,6 @@ stage_state_cb (ClutterStage *stage,
printf("[stage signal] %s\n", detail);
}
static gboolean
blue_button_cb (ClutterActor *actor,
ClutterEvent *event,
gpointer data)
{
ClutterActor *stage;
stage = clutter_actor_get_stage (actor);
if (IsFullScreen)
IsFullScreen = FALSE;
else
IsFullScreen = TRUE;
clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), IsFullScreen);
g_print ("*** Fullscreen %s ***\n",
IsFullScreen ? "enabled" : "disabled");
return FALSE;
}
static gboolean
red_button_cb (ClutterActor *actor,
ClutterEvent *event,
@ -429,10 +407,6 @@ test_events_main (int argc, char *argv[])
clutter_actor_set_name (stage, "Stage");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
g_signal_connect (stage, "event", G_CALLBACK (input_cb), (char *) "stage");
g_signal_connect (stage, "fullscreen",
G_CALLBACK (stage_state_cb), (char *) "fullscreen");
g_signal_connect (stage, "unfullscreen",
G_CALLBACK (stage_state_cb), (char *) "unfullscreen");
g_signal_connect (stage, "activate",
G_CALLBACK (stage_state_cb), (char *) "activate");
g_signal_connect (stage, "deactivate",
@ -468,19 +442,6 @@ test_events_main (int argc, char *argv[])
focus_box);
g_signal_connect (actor, "captured-event", G_CALLBACK (capture_cb), NULL);
actor = clutter_rectangle_new_with_color (CLUTTER_COLOR_Blue);
clutter_actor_set_name (actor, "Blue Box");
clutter_actor_set_size (actor, 100, 100);
clutter_actor_set_position (actor, 400, 100);
clutter_actor_set_reactive (actor, TRUE);
clutter_container_add (CLUTTER_CONTAINER(stage), actor, NULL);
g_signal_connect (actor, "event", G_CALLBACK (input_cb), (char *) "blue box");
g_signal_connect (actor, "key-focus-in", G_CALLBACK (key_focus_in_cb),
focus_box);
/* Fullscreen */
g_signal_connect (actor, "button-press-event",
G_CALLBACK (blue_button_cb), NULL);
/* non reactive */
actor = clutter_rectangle_new_with_color (CLUTTER_COLOR_Black);
clutter_actor_set_name (actor, "Black Box");

View File

@ -218,10 +218,6 @@ test_grab_main (int argc, char *argv[])
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
g_signal_connect (stage, "event",
G_CALLBACK (debug_event_cb), (char *) "stage");
g_signal_connect (stage, "fullscreen",
G_CALLBACK (stage_state_cb), (char *) "fullscreen");
g_signal_connect (stage, "unfullscreen",
G_CALLBACK (stage_state_cb), (char *) "unfullscreen");
g_signal_connect (stage, "activate",
G_CALLBACK (stage_state_cb), (char *) "activate");
g_signal_connect (stage, "deactivate",

View File

@ -8,13 +8,6 @@ test_stage_sizing_main (int argc, char *argv[]);
const char *
test_stage_sizing_describe (void);
static gboolean
fullscreen_clicked_cb (ClutterStage *stage)
{
clutter_stage_set_fullscreen (stage, !clutter_stage_get_fullscreen (stage));
return CLUTTER_EVENT_STOP;
}
static gboolean
shrink_clicked_cb (ClutterActor *stage)
{
@ -33,22 +26,6 @@ expand_clicked_cb (ClutterActor *stage)
return CLUTTER_EVENT_STOP;
}
static void
on_fullscreen (ClutterStage *stage)
{
float width, height;
gboolean is_fullscreen;
is_fullscreen = clutter_stage_get_fullscreen (stage);
clutter_actor_get_size (CLUTTER_ACTOR (stage), &width, &height);
g_print ("Stage size [%s]: %d x %d\n",
is_fullscreen ? "fullscreen" : "not fullscreen",
(int) width,
(int) height);
}
G_MODULE_EXPORT int
test_stage_sizing_main (int argc, char *argv[])
{
@ -61,27 +38,12 @@ test_stage_sizing_main (int argc, char *argv[])
stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Stage Sizing");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
g_signal_connect_after (stage, "notify::fullscreen-set", G_CALLBACK (on_fullscreen), NULL);
box = clutter_actor_new ();
clutter_actor_set_layout_manager (box, clutter_box_layout_new ());
clutter_actor_add_constraint (box, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
clutter_actor_add_child (stage, box);
rect = clutter_actor_new ();
clutter_actor_set_layout_manager (rect,
clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
CLUTTER_BIN_ALIGNMENT_CENTER));
clutter_actor_set_background_color (rect, CLUTTER_COLOR_LightScarletRed);
clutter_actor_set_reactive (rect, TRUE);
g_signal_connect_swapped (rect, "button-press-event",
G_CALLBACK (fullscreen_clicked_cb),
stage);
label = clutter_text_new_with_text ("Sans 16", "Toggle fullscreen");
clutter_actor_set_margin (label, &margin);
clutter_actor_add_child (rect, label);
clutter_actor_add_child (box, rect);
rect = clutter_actor_new ();
clutter_actor_set_layout_manager (rect,
clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,