Commit e69b4c1b authored by Christian Persch's avatar Christian Persch
Browse files

Fix build with gtk 3 rendering cleanup branch

parent 65dfcff5
......@@ -4922,8 +4922,11 @@ vte_translate_national_ctrlkeys (GdkEventKey *event)
GdkModifierType consumed_modifiers;
GdkKeymap *keymap;
keymap = gdk_keymap_get_for_display (
gdk_drawable_get_display (event->window));
#if GTK_CHECK_VERSION (2, 90, 8)
keymap = gdk_keymap_get_for_display(gdk_window_get_display (event->window));
#else
keymap = gdk_keymap_get_for_display(gdk_drawable_get_display (event->window));
#endif
gdk_keymap_translate_keyboard_state (keymap,
event->hardware_keycode, event->state,
......@@ -4939,16 +4942,19 @@ vte_translate_national_ctrlkeys (GdkEventKey *event)
static void
vte_terminal_read_modifiers (VteTerminal *terminal,
GdkEvent *event)
GdkEvent *event)
{
GdkModifierType modifiers;
/* Read the modifiers. */
if (gdk_event_get_state((GdkEvent*)event, &modifiers)) {
GdkKeymap *keymap;
keymap = gdk_keymap_get_for_display (
gdk_drawable_get_display (((GdkEventAny *)event)->window));
gdk_keymap_add_virtual_modifiers (keymap, &modifiers);
#if GTK_CHECK_VERSION (2, 90, 8)
keymap = gdk_keymap_get_for_display(gdk_window_get_display(((GdkEventAny*)event)->window));
#else
keymap = gdk_keymap_get_for_display(gdk_drawable_get_display(((GdkEventAny*)event)->window));
#endif
gdk_keymap_add_virtual_modifiers (keymap, &modifiers);
terminal->pvt->modifiers = modifiers;
}
}
......@@ -8726,7 +8732,9 @@ vte_terminal_realize(GtkWidget *widget)
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
#if !GTK_CHECK_VERSION (2, 90, 8)
attributes.colormap = gtk_widget_get_colormap (widget);
#endif
attributes.event_mask = gtk_widget_get_events(widget) |
GDK_EXPOSURE_MASK |
GDK_VISIBILITY_NOTIFY_MASK |
......@@ -8743,7 +8751,9 @@ vte_terminal_realize(GtkWidget *widget)
attributes_mask = GDK_WA_X |
GDK_WA_Y |
(attributes.visual ? GDK_WA_VISUAL : 0) |
#if !GTK_CHECK_VERSION (2, 90, 8)
(attributes.colormap ? GDK_WA_COLORMAP : 0) |
#endif
GDK_WA_CURSOR;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
......
......@@ -538,7 +538,11 @@ int
main(int argc, char **argv)
{
GdkScreen *screen;
#if GTK_CHECK_VERSION (2, 90, 8)
GdkVisual *visual;
#else
GdkColormap *colormap;
#endif
GtkWidget *window, *widget,*hbox = NULL, *scrollbar, *scrolled_window = NULL;
VteTerminal *terminal;
char *env_add[] = {
......@@ -788,9 +792,15 @@ main(int argc, char **argv)
/* Set ARGB colormap */
screen = gtk_widget_get_screen (window);
#if GTK_CHECK_VERSION (2, 90, 8)
visual = gdk_screen_get_rgba_visual(screen);
if (visual)
gtk_window_set_visual(GTK_WINDOW(window), visual);
#else
colormap = gdk_screen_get_rgba_colormap (screen);
if (colormap)
gtk_widget_set_colormap(window, colormap);
#endif
if (use_scrolled_window) {
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
......
......@@ -240,7 +240,11 @@ vte_bg_get_for_screen(GdkScreen *screen)
window = gdk_screen_get_root_window(screen);
pvt->native.window = window;
pvt->native.native_window = gdk_x11_drawable_get_xid(window);
#if GTK_CHECK_VERSION (2, 90, 8)
pvt->native.display = gdk_window_get_display(window);
#else
pvt->native.display = gdk_drawable_get_display(GDK_DRAWABLE(window));
#endif
pvt->native.native_atom = gdk_x11_get_xatom_by_name_for_display(pvt->native.display, "_XROOTPMAP_ID");
pvt->native.atom = gdk_x11_xatom_to_atom_for_display(pvt->native.display, pvt->native.native_atom);
pvt->root_surface = vte_bg_root_surface(bg);
......
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