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

rendering: Remove unneeded redraw after button release

parent f9fbd3fb
......@@ -61,10 +61,6 @@ typedef struct _EekGtkKeyboardPrivate
static void render_pressed_button (GtkWidget *widget, struct button_place *place);
static void render_released_button (GtkWidget *widget,
const struct squeek_button *button);
static void
eek_gtk_keyboard_real_realize (GtkWidget *self)
......@@ -341,47 +337,3 @@ eek_gtk_render_locked_button (EekGtkKeyboard *self, struct button_place place)
cairo_region_destroy (region);
// TODO: does it really redraw the entire keyboard?
static void
render_released_button (GtkWidget *widget,
const struct squeek_button *button)
EekGtkKeyboard *self = EEK_GTK_KEYBOARD (widget);
EekGtkKeyboardPrivate *priv = eek_gtk_keyboard_get_instance_private (self);
GdkWindow *window = gtk_widget_get_window (widget);
cairo_region_t *region = gdk_window_get_clip_region (window);
GdkDrawingContext *context = gdk_window_begin_draw_frame (window, region);
cairo_t *cr = gdk_drawing_context_get_cairo_context (context);
eek_renderer_render_keyboard (priv->renderer, cr);
gdk_window_end_draw_frame (window, context);
cairo_region_destroy (region);
eek_gtk_on_button_released (const struct squeek_button *button,
struct squeek_view *view,
EekGtkKeyboard *self)
EekGtkKeyboardPrivate *priv = eek_gtk_keyboard_get_instance_private (self);
/* renderer may have not been set yet if the widget is a popup */
if (!priv->renderer)
render_released_button (GTK_WIDGET(self), button);
gtk_widget_queue_draw (GTK_WIDGET(self));
ca_gtk_play_for_widget (widget, 0,
CA_PROP_EVENT_ID, "button-released",
CA_PROP_EVENT_DESCRIPTION, "virtual key pressed",
CA_PROP_APPLICATION_ID, "org.fedorahosted.Eekboard",
......@@ -308,16 +308,6 @@ pub mod c {
origin: Point,
angle: i32
) -> u32;
// Button and View are safe to pass to C
// as long as they don't outlive the call
// and nothing dereferences them
pub fn eek_gtk_on_button_released(
button: *const Button,
view: *const View,
keyboard: EekGtkKeyboard,
/// Places each button in order, starting from 0 on the left,
......@@ -904,24 +894,6 @@ mod procedures {
c::procedures::eek_are_bounds_inside(bounds, point, origin, angle)
}) == 1
/// Switch off all UI buttons associated with the (state) key
pub fn release_ui_buttons(
view: &Box<View>,
key: &Rc<RefCell<KeyState>>,
ui_keyboard: c::EekGtkKeyboard,
) {
let paths = ::layout::procedures::find_key_paths(&view, key);
for (_row, button) in paths {
unsafe {
button.as_ref() as *const Button,
view.as_ref() as *const View,
mod test {
......@@ -1036,9 +1008,6 @@ mod seat {
// TODO: move one level up; multiple buttons might have been released
procedures::release_ui_buttons(view, key, ui_keyboard);
Supports Markdown
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