Some minor cleanups
This commit is contained in:
@ -95,9 +95,8 @@ on_notify_keyboard (GObject *object,
|
|||||||
|
|
||||||
keyboard = eekboard_context_service_get_keyboard (EEKBOARD_CONTEXT_SERVICE(context));
|
keyboard = eekboard_context_service_get_keyboard (EEKBOARD_CONTEXT_SERVICE(context));
|
||||||
|
|
||||||
if (!keyboard) {
|
if (!keyboard)
|
||||||
g_error("Programmer error: keyboard layout was unset!");
|
g_error("Programmer error: keyboard layout was unset!");
|
||||||
}
|
|
||||||
|
|
||||||
// The keymap will get set even if the window is hidden.
|
// The keymap will get set even if the window is hidden.
|
||||||
// It's not perfect,
|
// It's not perfect,
|
||||||
@ -277,12 +276,12 @@ set_geometry (ServerContextService *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
make_window (ServerContextService *context) {
|
make_window (ServerContextService *context)
|
||||||
if (context->window) {
|
{
|
||||||
|
if (context->window)
|
||||||
g_error("Window already present");
|
g_error("Window already present");
|
||||||
return;
|
|
||||||
}
|
context->window = g_object_new (
|
||||||
context->window = GTK_WIDGET(g_object_new (
|
|
||||||
PHOSH_TYPE_LAYER_SURFACE,
|
PHOSH_TYPE_LAYER_SURFACE,
|
||||||
"layer-shell", squeek_wayland->layer_shell,
|
"layer-shell", squeek_wayland->layer_shell,
|
||||||
"wl-output", g_ptr_array_index(squeek_wayland->outputs, 0), // TODO: select output as needed,
|
"wl-output", g_ptr_array_index(squeek_wayland->outputs, 0), // TODO: select output as needed,
|
||||||
@ -295,12 +294,16 @@ make_window (ServerContextService *context) {
|
|||||||
"exclusive-zone", 200,
|
"exclusive-zone", 200,
|
||||||
//"namespace", "phosh home",
|
//"namespace", "phosh home",
|
||||||
NULL
|
NULL
|
||||||
));
|
);
|
||||||
|
|
||||||
g_signal_connect (context->window, "destroy",
|
g_signal_connect (context->window, "destroy",
|
||||||
G_CALLBACK(on_destroy), context);
|
G_CALLBACK(on_destroy),
|
||||||
|
context);
|
||||||
|
|
||||||
context->notify_visible_handler =
|
context->notify_visible_handler =
|
||||||
g_signal_connect (context->window, "notify::visible",
|
g_signal_connect (context->window, "notify::visible",
|
||||||
G_CALLBACK(on_notify_visible), context);
|
G_CALLBACK(on_notify_visible),
|
||||||
|
context);
|
||||||
|
|
||||||
// FIXME: these properties could all be set in g_object_new()
|
// FIXME: these properties could all be set in g_object_new()
|
||||||
// The properties below are just to make hacking easier.
|
// The properties below are just to make hacking easier.
|
||||||
@ -387,8 +390,7 @@ server_context_service_real_disabled (EekboardContextService *_context)
|
|||||||
ServerContextService *context = SERVER_CONTEXT_SERVICE(_context);
|
ServerContextService *context = SERVER_CONTEXT_SERVICE(_context);
|
||||||
|
|
||||||
if (context->window) {
|
if (context->window) {
|
||||||
context->was_visible =
|
context->was_visible = gtk_widget_get_visible (context->window);
|
||||||
gtk_widget_get_visible (context->window);
|
|
||||||
gtk_widget_hide (context->window);
|
gtk_widget_hide (context->window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -498,6 +500,5 @@ server_context_service_init (ServerContextService *context)
|
|||||||
EekboardContextService *
|
EekboardContextService *
|
||||||
server_context_service_new ()
|
server_context_service_new ()
|
||||||
{
|
{
|
||||||
return EEKBOARD_CONTEXT_SERVICE(g_object_new (SERVER_TYPE_CONTEXT_SERVICE,
|
return EEKBOARD_CONTEXT_SERVICE(g_object_new (SERVER_TYPE_CONTEXT_SERVICE, NULL));
|
||||||
NULL));
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user