Skip to content

Commit

Permalink
input: force redraw when changing input shape under Wayland
Browse files Browse the repository at this point in the history
Closes #136
  • Loading branch information
bk138 committed Feb 4, 2022
1 parent 570b883 commit b7bb607
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ void release_grab (GromitData *data,
cairo_region_t *r = cairo_region_create();
gtk_widget_input_shape_combine_region(data->win, r);
cairo_region_destroy(r);

// force a redraw, otherwise input shape is not applied,
// at least on newer GNOME versions
gdk_window_invalidate_rect(gtk_widget_get_window(data->win), NULL, 0);
}


Expand Down Expand Up @@ -448,6 +452,9 @@ void acquire_grab (GromitData *data,
cairo_region_t *r = cairo_region_create_rectangle(&rect);
gtk_widget_input_shape_combine_region(data->win, r);
cairo_region_destroy(r);
// force a redraw, otherwise input shape is not applied,
// at least on newer GNOME versions
gdk_window_invalidate_rect(gtk_widget_get_window(data->win), NULL, 0);
}

if(!dev) /* this means grab all */
Expand Down

0 comments on commit b7bb607

Please sign in to comment.