Commit 037cb1da authored by Nalin Dahyabhai's avatar Nalin Dahyabhai

watch for Visibility events. don't synthesize an expose event if we're

* src/vte.c(vte_terminal_visibility_notify): watch for Visibility events.
* src/vte.c(vte_invalidate_cells,vte_invalidate_all): don't synthesize an
	expose event if we're fully obscured, that's just silly.
parent e99c7b9d
2003-03-07 nalin
* src/vte.c(vte_terminal_visibility_notify): watch for Visibility
events.
* src/vte.c(vte_invalidate_cells,vte_invalidate_all): don't synthesize
an expose event if we're fully obscured, that's just silly.
2003-03-06 nalin
* src/vte.c, src/vte.h(vte_terminal_set_background_tint_color): take a
const GdkColor* instead of a non-const color.
......
......@@ -403,6 +403,9 @@ struct _VteTerminalPrivate {
/* Key modifiers. */
GdkModifierType modifiers;
/* Obscured? state. */
GdkVisibilityState visibility_state;
};
/* A function which can handle a terminal control sequence. */
......@@ -675,6 +678,9 @@ vte_invalidate_cells(VteTerminal *terminal,
if (!GTK_WIDGET_REALIZED(widget)) {
return;
}
if (terminal->pvt->visibility_state == GDK_VISIBILITY_FULLY_OBSCURED) {
return;
}
/* Subtract the scrolling offset from the row start so that the
* resulting rectangle is relative to the visible portion of the
......@@ -710,6 +716,9 @@ vte_invalidate_all(VteTerminal *terminal)
if (!GTK_WIDGET_REALIZED(widget)) {
return;
}
if (terminal->pvt->visibility_state == GDK_VISIBILITY_FULLY_OBSCURED) {
return;
}
/* Expose the entire widget area. */
rect.x = 0;
......@@ -9895,6 +9904,15 @@ vte_terminal_focus_out(GtkWidget *widget, GdkEventFocus *event)
return FALSE;
}
static gint
vte_terminal_visibility_notify(GtkWidget *widget, GdkEventVisibility *event)
{
g_return_val_if_fail(GTK_WIDGET(widget), FALSE);
g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
(VTE_TERMINAL(widget))->pvt->visibility_state = event->state;
return FALSE;
}
static void
vte_terminal_font_complain(const char *font,
char **missing_charset_list,
......@@ -11654,6 +11672,9 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass)
/* Clear modifiers. */
pvt->modifiers = 0;
/* Assume we're visible unless we're told otherwise. */
pvt->visibility_state = GDK_VISIBILITY_UNOBSCURED;
/* Listen for hierarchy change notifications. */
g_signal_connect(G_OBJECT(terminal), "hierarchy-changed",
G_CALLBACK(vte_terminal_hierarchy_changed),
......@@ -12260,6 +12281,7 @@ vte_terminal_realize(GtkWidget *widget)
attributes.colormap = gtk_widget_get_colormap(widget);
attributes.event_mask = gtk_widget_get_events(widget) |
GDK_EXPOSURE_MASK |
GDK_VISIBILITY_NOTIFY_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK |
......@@ -12350,6 +12372,9 @@ vte_terminal_realize(GtkWidget *widget)
/* Clear modifiers. */
terminal->pvt->modifiers = 0;
/* Assume we're visible unless we're told otherwise. */
terminal->pvt->visibility_state = GDK_VISIBILITY_UNOBSCURED;
/* Create our invisible cursor. */
bitmap = gdk_bitmap_create_from_data(widget->window, "\0", 1, 1);
terminal->pvt->mouse_inviso_cursor = gdk_cursor_new_from_pixmap(bitmap,
......@@ -14949,6 +14974,7 @@ vte_terminal_class_init(VteTerminalClass *klass, gconstpointer data)
widget_class->motion_notify_event = vte_terminal_motion_notify;
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->unrealize = vte_terminal_unrealize;
widget_class->size_request = vte_terminal_size_request;
widget_class->size_allocate = vte_terminal_size_allocate;
......
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