More GTK 2.22.0 support
svn path=/trunk/netsurf/; revision=10897
This commit is contained in:
parent
c94bf68751
commit
52f7f6a620
|
@ -22,6 +22,18 @@
|
|||
|
||||
#include "gtk/gtk_compat.h"
|
||||
|
||||
void nsgtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(2,22,0)
|
||||
gtk_widget_set_can_focus(widget, can_focus);
|
||||
#else
|
||||
if (can_focus == TRUE)
|
||||
GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);
|
||||
else
|
||||
GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean nsgtk_widget_has_focus(GtkWidget *widget)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(2,20,0)
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
void nsgtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus);
|
||||
gboolean nsgtk_widget_has_focus(GtkWidget *widget);
|
||||
gboolean nsgtk_widget_get_visible(GtkWidget *widget);
|
||||
gboolean nsgtk_widget_get_realized(GtkWidget *widget);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "desktop/searchweb.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "desktop/selection.h"
|
||||
#include "gtk/gtk_compat.h"
|
||||
#include "gtk/gtk_gui.h"
|
||||
#include "gtk/options.h"
|
||||
#include "gtk/gtk_scaffolding.h"
|
||||
|
@ -302,7 +303,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
|
|||
GDK_KEY_PRESS_MASK |
|
||||
GDK_KEY_RELEASE_MASK |
|
||||
GDK_SCROLL_MASK);
|
||||
GTK_WIDGET_SET_FLAGS(GTK_WIDGET(g->layout), GTK_CAN_FOCUS);
|
||||
nsgtk_widget_set_can_focus(GTK_WIDGET(g->layout), TRUE);
|
||||
|
||||
/* set the default background colour of the drawing area to white. */
|
||||
gtk_widget_modify_bg(GTK_WIDGET(g->layout), GTK_STATE_NORMAL,
|
||||
|
|
Loading…
Reference in New Issue