[planner: 21/32] Drop keyboard/mouse regrab hacks after combo choosing in popup windows
- From: Mart Raudsepp <mraudsepp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner: 21/32] Drop keyboard/mouse regrab hacks after combo choosing in popup windows
- Date: Sun, 20 Jun 2021 18:13:51 +0000 (UTC)
commit d4043fbc90bdec36c42c4884033228d2febc416a
Author: Mart Raudsepp <leio gentoo org>
Date: Fri Jun 11 00:22:00 2021 +0300
Drop keyboard/mouse regrab hacks after combo choosing in popup windows
They don't seem to be necessary anymore, even with current gtk2 with the
previous GtkOptionMenu code, or the effect of it is misunderstood by me.
src/planner-cell-renderer-date.c | 27 ---------------------------
src/planner-task-date-widget.c | 27 ---------------------------
2 files changed, 54 deletions(-)
---
diff --git a/src/planner-cell-renderer-date.c b/src/planner-cell-renderer-date.c
index e9c809d6..1f2b3103 100644
--- a/src/planner-cell-renderer-date.c
+++ b/src/planner-cell-renderer-date.c
@@ -453,26 +453,6 @@ mcrd_day_selected (GtkWidget *popup_window,
g_free (str);
}
-static gboolean
-mcrd_grab_on_window (GdkWindow *window,
- guint32 activate_time)
-{
- if ((gdk_pointer_grab (window, TRUE,
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK,
- NULL, NULL, activate_time) == 0)) {
- if (gdk_keyboard_grab (window, TRUE,
- activate_time) == 0)
- return TRUE;
- else {
- gdk_pointer_ungrab (activate_time);
- return FALSE;
- }
- }
-
- return FALSE;
-}
-
static void
mcrd_constraint_activated_cb (GtkComboBox *combo,
PlannerCellRendererDate *cell)
@@ -500,11 +480,4 @@ mcrd_constraint_activated_cb (GtkComboBox *combo,
gtk_widget_set_sensitive (cell->calendar, sensitive);
gtk_widget_set_sensitive (cell->today_button, sensitive);
-
- /* A bit hackish. Grab focus on the popup window again when the
- * optionmenu is activated, since focus is transferred to the optionmenu
- * when it's popped up.
- */
- mcrd_grab_on_window (gtk_widget_get_window (PLANNER_CELL_RENDERER_POPUP (cell)->popup_window),
- gtk_get_current_event_time ());
}
diff --git a/src/planner-task-date-widget.c b/src/planner-task-date-widget.c
index f6325fa2..e4863cdb 100644
--- a/src/planner-task-date-widget.c
+++ b/src/planner-task-date-widget.c
@@ -120,25 +120,6 @@ task_date_day_selected_double_click_cb (GtkWidget *calendar,
g_signal_emit (widget, signals[DATE_SELECTED], 0);
}
-static gboolean
-grab_on_window (GdkWindow *window,
- guint32 time)
-{
- if ((gdk_pointer_grab (window, TRUE,
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK,
- NULL, NULL, time) == 0)) {
- if (gdk_keyboard_grab (window, TRUE, time) == 0)
- return TRUE;
- else {
- gdk_pointer_ungrab (time);
- return FALSE;
- }
- }
-
- return FALSE;
-}
-
static void
task_date_widget_combo_changed_cb (GtkComboBox *combo,
PlannerTaskDateWidget *widget)
@@ -150,14 +131,6 @@ task_date_widget_combo_changed_cb (GtkComboBox *combo,
type = planner_task_date_widget_get_constraint_type (widget);
gtk_widget_set_sensitive (priv->calendar, type != MRP_CONSTRAINT_ASAP);
-
- /* A bit hackish. Grab focus on the popup widget again when the combo
- * has been used, since focus is transferred to the combo when it's
- * popped up.
- */
- if (gtk_widget_get_window (GTK_WIDGET (widget))) {
- grab_on_window (gtk_widget_get_window (GTK_WIDGET (widget)), gtk_get_current_event_time ());
- }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]