gtkglext-1.2.0-bz677457.diff 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. diff -Naur gtkglext-1.2.0.orig/gtk/gtkglwidget.c gtkglext-1.2.0/gtk/gtkglwidget.c
  2. --- gtkglext-1.2.0.orig/gtk/gtkglwidget.c 2004-02-20 10:38:36.000000000 +0100
  3. +++ gtkglext-1.2.0/gtk/gtkglwidget.c 2011-02-16 19:06:48.383730534 +0100
  4. @@ -16,7 +16,9 @@
  5. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  6. */
  7. -#include <gtk/gtkmain.h>
  8. +#ifdef HAVE_CONFIG_H
  9. +#include "config.h"
  10. +#endif /* HAVE_CONFIG_H */
  11. #include "gtkglprivate.h"
  12. #include "gtkglwidget.h"
  13. @@ -68,6 +70,7 @@
  14. gtk_gl_widget_realize (GtkWidget *widget,
  15. GLWidgetPrivate *private)
  16. {
  17. + GdkWindow *window;
  18. GdkGLWindow *glwindow;
  19. GTK_GL_NOTE_FUNC_PRIVATE ();
  20. @@ -77,9 +80,10 @@
  21. * handlers.
  22. */
  23. - if (!gdk_window_is_gl_capable (widget->window))
  24. + window = gtk_widget_get_window (widget);
  25. + if (!gdk_window_is_gl_capable (window))
  26. {
  27. - glwindow = gdk_window_set_gl_capability (widget->window,
  28. + glwindow = gdk_window_set_gl_capability (window,
  29. private->glconfig,
  30. NULL);
  31. if (glwindow == NULL)
  32. @@ -127,9 +131,9 @@
  33. * Synchronize OpenGL and window resizing request streams.
  34. */
  35. - if (GTK_WIDGET_REALIZED (widget) && private->is_realized)
  36. + if (gtk_widget_get_realized (widget) && private->is_realized)
  37. {
  38. - gldrawable = gdk_window_get_gl_drawable (widget->window);
  39. + gldrawable = gdk_window_get_gl_drawable (gtk_widget_get_window (widget));
  40. gdk_gl_drawable_wait_gdk (gldrawable);
  41. }
  42. }
  43. @@ -146,7 +150,7 @@
  44. if (private->glcontext != NULL)
  45. {
  46. - gdk_gl_context_destroy (private->glcontext);
  47. + g_object_unref (private->glcontext);
  48. private->glcontext = NULL;
  49. }
  50. @@ -154,8 +158,8 @@
  51. * Remove OpenGL-capability from widget->window.
  52. */
  53. - if (GTK_WIDGET_REALIZED (widget))
  54. - gdk_window_unset_gl_capability (widget->window);
  55. + if (gtk_widget_get_realized (widget))
  56. + gdk_window_unset_gl_capability (gtk_widget_get_window (widget));
  57. private->is_realized = FALSE;
  58. }
  59. @@ -174,7 +178,7 @@
  60. */
  61. toplevel = gtk_widget_get_toplevel (widget);
  62. - if (GTK_WIDGET_TOPLEVEL (toplevel) && !GTK_WIDGET_REALIZED (toplevel))
  63. + if (gtk_widget_is_toplevel (toplevel) && !gtk_widget_get_realized (toplevel))
  64. {
  65. GTK_GL_NOTE (MISC,
  66. g_message (" - Install colormap to the top-level window."));
  67. @@ -188,23 +192,27 @@
  68. GtkStyle *previous_style,
  69. gpointer user_data)
  70. {
  71. + GdkWindow *window;
  72. +
  73. GTK_GL_NOTE_FUNC_PRIVATE ();
  74. /*
  75. * Set a background of "None" on window to avoid AIX X server crash.
  76. */
  77. - if (GTK_WIDGET_REALIZED (widget))
  78. + if (gtk_widget_get_realized (widget))
  79. {
  80. + window = gtk_widget_get_window (widget);
  81. +
  82. GTK_GL_NOTE (MISC,
  83. g_message (" - window->bg_pixmap = %p",
  84. - ((GdkWindowObject *) (widget->window))->bg_pixmap));
  85. + ((GdkWindowObject *) window)->bg_pixmap));
  86. - gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
  87. + gdk_window_set_back_pixmap (window, NULL, FALSE);
  88. GTK_GL_NOTE (MISC,
  89. g_message (" - window->bg_pixmap = %p",
  90. - ((GdkWindowObject *) (widget->window))->bg_pixmap));
  91. + ((GdkWindowObject *) window)->bg_pixmap));
  92. }
  93. }
  94. @@ -250,8 +258,8 @@
  95. GTK_GL_NOTE_FUNC ();
  96. g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
  97. - g_return_val_if_fail (!GTK_WIDGET_NO_WINDOW (widget), FALSE);
  98. - g_return_val_if_fail (!GTK_WIDGET_REALIZED (widget), FALSE);
  99. + g_return_val_if_fail (gtk_widget_get_has_window (widget), FALSE);
  100. + g_return_val_if_fail (!gtk_widget_get_realized (widget), FALSE);
  101. g_return_val_if_fail (GDK_IS_GL_CONFIG (glconfig), FALSE);
  102. /*
  103. @@ -432,9 +440,9 @@
  104. GTK_GL_NOTE_FUNC ();
  105. g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
  106. - g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
  107. + g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
  108. - gldrawable = gdk_window_get_gl_drawable (widget->window);
  109. + gldrawable = gdk_window_get_gl_drawable (gtk_widget_get_window (widget));
  110. if (gldrawable == NULL)
  111. return NULL;
  112. @@ -474,7 +482,7 @@
  113. GLWidgetPrivate *private;
  114. g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
  115. - g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
  116. + g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
  117. private = g_object_get_qdata (G_OBJECT (widget), quark_gl_private);
  118. if (private == NULL)
  119. @@ -501,7 +509,7 @@
  120. gtk_widget_get_gl_window (GtkWidget *widget)
  121. {
  122. g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
  123. - g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
  124. + g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
  125. - return gdk_window_get_gl_window (widget->window);
  126. + return gdk_window_get_gl_window (gtk_widget_get_window (widget));
  127. }