[vte/vte-0-50] widget: Remove GdkVisibilityState handling
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-0-50] widget: Remove GdkVisibilityState handling
- Date: Tue, 3 Apr 2018 10:52:29 +0000 (UTC)
commit 8610f40913e0bda2656f81478d2f4932fa667152
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Mar 9 19:51:03 2018 +0100
widget: Remove GdkVisibilityState handling
GtkWidget::visibility-notify-event doesn't work on modern composited
windowing systems. In such cases one can only assume that the widget
is always completely visible (ie. GDK_VISIBILITY_UNOBSCURED).
These days most users have a compositor, and therefore bugs in this
optimization often manage to survive undetected.
https://bugzilla.gnome.org/show_bug.cgi?id=794214
(cherry picked from commit b54395869c408656f31493a25f9e9fe89cd56bb7)
Conflicts:
src/vte.cc
src/vte.cc | 53 +---------------------------------------------------
src/vtegtk.cc | 9 --------
src/vteinternal.hh | 4 ---
3 files changed, 1 insertions(+), 65 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index a9f73e2..f1d7aee 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -7479,42 +7479,6 @@ visibility_state_str(GdkVisibilityState state)
}
}
-void
-VteTerminalPrivate::widget_visibility_notify(GdkEventVisibility *event)
-{
- _vte_debug_print(VTE_DEBUG_EVENTS | VTE_DEBUG_MISC,
- "Visibility (%s -> %s).\n",
- visibility_state_str(m_visibility_state),
- visibility_state_str(event->state));
-
- if (event->state == m_visibility_state) {
- return;
- }
-
- /* fully obscured to visible switch, force the fast path */
- if (m_visibility_state == GDK_VISIBILITY_FULLY_OBSCURED) {
- /* set invalidated_all false, since we didn't really mean it
- * when we set it to TRUE when becoming obscured */
- m_invalidated_all = FALSE;
-
- /* if all unobscured now, invalidate all, otherwise, wait
- * for the expose event */
- if (event->state == GDK_VISIBILITY_UNOBSCURED) {
- invalidate_all();
- }
- }
-
- m_visibility_state = event->state;
-
- /* no longer visible, stop processing display updates */
- if (m_visibility_state == GDK_VISIBILITY_FULLY_OBSCURED) {
- remove_update_timeout(this);
- /* if fully obscured, just act like we have invalidated all,
- * so no updates are accumulated. */
- m_invalidated_all = TRUE;
- }
-}
-
/* Apply the changed metrics, and queue a resize if need be. */
void
VteTerminalPrivate::apply_font_metrics(int width,
@@ -7917,8 +7881,6 @@ VteTerminalPrivate::vadjustment_value_changed()
/* Sanity checks. */
if (G_UNLIKELY(!widget_realized()))
return;
- if (m_visibility_state == GDK_VISIBILITY_FULLY_OBSCURED)
- return;
/* FIXME: do this check in pixel space */
if (dy != 0) {
@@ -8147,10 +8109,6 @@ VteTerminalPrivate::VteTerminalPrivate(VteTerminal *t) :
m_allow_hyperlink = FALSE;
m_hyperlink_auto_id = 0;
- /* Not all backends generate GdkVisibilityNotify, so mark the
- * window as unobscured initially. */
- m_visibility_state = GDK_VISIBILITY_UNOBSCURED;
-
m_padding = default_padding;
update_view_extents();
@@ -8613,7 +8571,6 @@ VteTerminalPrivate::widget_realize()
attributes.visual = gtk_widget_get_visual(m_widget);
attributes.event_mask = gtk_widget_get_events(m_widget) |
GDK_EXPOSURE_MASK |
- GDK_VISIBILITY_NOTIFY_MASK |
GDK_FOCUS_CHANGE_MASK |
GDK_SMOOTH_SCROLL_MASK |
GDK_SCROLL_MASK |
@@ -10554,11 +10511,7 @@ void
VteTerminalPrivate::reset_update_rects()
{
g_array_set_size(m_update_rects, 0);
-
- /* The invalidated_all flag also marks whether to skip processing
- * due to the widget being invisible.
- */
- m_invalidated_all = m_visibility_state == GDK_VISIBILITY_FULLY_OBSCURED;
+ m_invalidated_all = FALSE;
}
static bool
@@ -10845,10 +10798,6 @@ VteTerminalPrivate::invalidate_dirty_rects_and_process_updates()
{
if (G_UNLIKELY(!widget_realized()))
return false;
- if (m_visibility_state == GDK_VISIBILITY_FULLY_OBSCURED) {
- reset_update_rects();
- return false;
- }
if (G_UNLIKELY (!m_update_rects->len))
return false;
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index 18a4b1b..57fd648 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -265,14 +265,6 @@ vte_terminal_leave(GtkWidget *widget, GdkEventCrossing *event)
return ret;
}
-static gboolean
-vte_terminal_visibility_notify(GtkWidget *widget, GdkEventVisibility *event)
-{
- VteTerminal *terminal = VTE_TERMINAL(widget);
- IMPL(terminal)->widget_visibility_notify(event);
- return FALSE;
-}
-
static void
vte_terminal_get_preferred_width(GtkWidget *widget,
int *minimum_width,
@@ -659,7 +651,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
widget_class->leave_notify_event = vte_terminal_leave;
widget_class->focus_in_event = vte_terminal_focus_in;
widget_class->focus_out_event = vte_terminal_focus_out;
- widget_class->visibility_notify_event = vte_terminal_visibility_notify;
widget_class->style_updated = vte_terminal_style_updated;
widget_class->get_preferred_width = vte_terminal_get_preferred_width;
widget_class->get_preferred_height = vte_terminal_get_preferred_height;
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 0cd686b..53dcc2e 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -512,9 +512,6 @@ public:
/* Key modifiers. */
guint m_modifiers;
- /* Obscured? state. */
- GdkVisibilityState m_visibility_state;
-
/* Font stuff. */
gboolean m_has_fonts;
long m_line_thickness;
@@ -673,7 +670,6 @@ public:
bool widget_button_release(GdkEventButton *event);
void widget_enter(GdkEventCrossing *event);
void widget_leave(GdkEventCrossing *event);
- void widget_visibility_notify(GdkEventVisibility *event);
void widget_scroll(GdkEventScroll *event);
bool widget_motion_notify(GdkEventMotion *event);
void widget_draw(cairo_t *cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]