Commit b8d36855 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

Merge branch 'fixes' into 'master'

Make virtboard wait properly wait  for wayland and glib events

Closes phosh#87 and #25

See merge request !33
parents 0bab93ed c4fefb91
Pipeline #16261 passed with stage
in 55 seconds
......@@ -1167,6 +1167,18 @@ make_visible(struct virtual_keyboard *keyboard) {
notify_visible(true);
}
static gboolean
make_visible_in_idle(struct virtual_keyboard *keyboard)
{
if (!dbus_interface || !keyboard->keyboard->scale)
return TRUE;
make_visible(keyboard);
return FALSE;
}
static void
make_hidden(struct virtual_keyboard *keyboard) {
if (!keyboard->layer_surface) {
......@@ -1421,8 +1433,12 @@ bus_name_acquired(GDBusConnection *connection,
{
// but let's follow minminbus for now and register objects here
dbus_interface = sm_puri_osk0_skeleton_new();
struct virtual_keyboard *virtual_keyboard = user_data;
gboolean shown;
sm_puri_osk0_set_visible(dbus_interface, false); // TODO: use actual value
shown = virtual_keyboard->layer_surface ? TRUE : FALSE;
g_debug("Acquired bus name, keyboad %sshown", shown ? "" : "not ");
sm_puri_osk0_set_visible(dbus_interface, shown);
g_signal_connect(dbus_interface, "handle-get-visible",
G_CALLBACK(handle_get_visible), user_data);
......@@ -1567,7 +1583,7 @@ main(int argc, char *argv[])
session_register();
if (virtual_keyboard.input_method_manager == NULL) {
make_visible(&virtual_keyboard);
g_idle_add ((GSourceFunc) make_visible_in_idle, &virtual_keyboard);
}
display_run(virtual_keyboard.display);
......
......@@ -3910,7 +3910,9 @@ void
window_inhibit_redraw(struct window *window)
{
window->redraw_inhibited = 1;
g_source_remove(window->redraw_task);
if (window->redraw_task)
g_source_remove(window->redraw_task);
window->redraw_task = 0;
window->redraw_task_scheduled = 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment