diff --git a/extensions/feed-panel/feed-panel.c b/extensions/feed-panel/feed-panel.c index 327237dc..de0d457e 100644 --- a/extensions/feed-panel/feed-panel.c +++ b/extensions/feed-panel/feed-panel.c @@ -840,7 +840,8 @@ feed_panel_init (FeedPanel* panel) webview = webkit_web_view_new (); #if GTK_CHECK_VERSION(3,0,0) - font_desc = gtk_style_context_get_font(gtk_widget_get_style_context(treeview), GTK_STATE_FLAG_NORMAL); + font_desc = (PangoFontDescription*)gtk_style_context_get_font ( + gtk_widget_get_style_context (treeview), GTK_STATE_FLAG_NORMAL); #else font_desc = treeview->style->font_desc; #endif diff --git a/extensions/toolbar-editor.c b/extensions/toolbar-editor.c index 6d3e10a3..8f9e36b1 100644 --- a/extensions/toolbar-editor.c +++ b/extensions/toolbar-editor.c @@ -394,11 +394,7 @@ static TBEditorWidget *tb_editor_create_dialog(MidoriBrowser *parent) GTK_WINDOW(parent), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); -#if !GTK_CHECK_VERSION(3,0,0) - vbox = (GTK_DIALOG(dialog))->vbox; -#else - vbox = GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))); -#endif + vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); gtk_box_set_spacing(GTK_BOX(vbox), 6); gtk_widget_set_name(dialog, "GeanyDialog"); gtk_window_set_default_size(GTK_WINDOW(dialog), -1, 400); diff --git a/katze/katze-throbber.c b/katze/katze-throbber.c index 195d38d2..85c206fc 100644 --- a/katze/katze-throbber.c +++ b/katze/katze-throbber.c @@ -902,6 +902,7 @@ katze_throbber_aligned_coords (GtkWidget* widget, #endif #if GTK_CHECK_VERSION (3, 0, 0) + allocation.x = allocation.y = 0; allocation.width = gtk_widget_get_allocated_width (widget); allocation.height = gtk_widget_get_allocated_height (widget); gtk_widget_get_preferred_size (widget, &requisition, NULL); diff --git a/midori/main.c b/midori/main.c index f1249088..deda05fa 100644 --- a/midori/main.c +++ b/midori/main.c @@ -996,7 +996,6 @@ static gboolean midori_load_soup_session (gpointer settings) { SoupSession* session = webkit_get_default_session (); - g_object_set_data (G_OBJECT (session), "midori-settings", settings); #if defined (HAVE_LIBSOUP_2_37_1) g_object_set (session, @@ -1036,6 +1035,7 @@ midori_load_soup_session (gpointer settings) NULL); #endif + g_object_set_data (G_OBJECT (session), "midori-settings", settings); soup_session_settings_notify_http_proxy_cb (settings, NULL, session); g_signal_connect (settings, "notify::http-proxy", G_CALLBACK (soup_session_settings_notify_http_proxy_cb), session); diff --git a/midori/midori-app.c b/midori/midori-app.c index e882810d..46400944 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -1349,7 +1349,9 @@ midori_app_setup (gchar** argument_vector) /* libSoup uses threads, therefore if WebKit is built with libSoup * or Midori is using it, we need to initialize threads. */ + #if !GLIB_CHECK_VERSION (2, 32, 0) if (!g_thread_supported ()) g_thread_init (NULL); + #endif #if ENABLE_NLS setlocale (LC_ALL, ""); diff --git a/midori/midori-browser.c b/midori/midori-browser.c index b4fbd3cc..776019ea 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -5799,7 +5799,6 @@ midori_browser_init (MidoriBrowser* browser) GtkSettings* gtk_settings; GtkWidget* hpaned; GtkWidget* vpaned; - GtkRcStyle* rcstyle; GtkWidget* scrolled; KatzeArray* dummy_array; @@ -6156,11 +6155,15 @@ midori_browser_init (MidoriBrowser* browser) gtk_paned_pack2 (GTK_PANED (hpaned), vpaned, TRUE, FALSE); gtk_widget_show (vpaned); browser->notebook = gtk_notebook_new (); + #if !GTK_CHECK_VERSION (3, 0, 0) + { /* Remove the inner border between scrollbars and the window border */ - rcstyle = gtk_rc_style_new (); + GtkRcStyle* rcstyle = gtk_rc_style_new (); rcstyle->xthickness = 0; gtk_widget_modify_style (browser->notebook, rcstyle); g_object_unref (rcstyle); + } + #endif gtk_notebook_set_scrollable (GTK_NOTEBOOK (browser->notebook), TRUE); gtk_paned_pack1 (GTK_PANED (vpaned), browser->notebook, FALSE, FALSE); g_signal_connect (browser->notebook, "switch-page", diff --git a/midori/midori-view.c b/midori/midori-view.c index 64abdc59..07ca24e7 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -2264,6 +2264,7 @@ midori_view_populate_popup (MidoriView* view, WebKitWebView* web_view = WEBKIT_WEB_VIEW (view->web_view); GtkWidget* widget = GTK_WIDGET (view); MidoriBrowser* browser = midori_browser_get_for_widget (widget); + GdkWindowState state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (browser))); GtkActionGroup* actions = midori_browser_get_action_group (browser); GtkMenuShell* menu_shell = GTK_MENU_SHELL (menu); GtkWidget* menuitem; @@ -2665,7 +2666,6 @@ midori_view_populate_popup (MidoriView* view, g_object_set_data (G_OBJECT (menuitem), "y", GINT_TO_POINTER (y)); } - GdkWindowState state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (browser))); if (state & GDK_WINDOW_STATE_FULLSCREEN) { menuitem = sokoke_action_create_popup_menu_item ( diff --git a/midori/sokoke.c b/midori/sokoke.c index 4b34c944..23a97b1d 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -64,13 +64,15 @@ sokoke_js_script_eval (JSContextRef js_context, { gchar* value; JSStringRef js_value_string; + JSStringRef js_script; + JSValueRef js_exception = NULL; + JSValueRef js_value; g_return_val_if_fail (js_context, FALSE); g_return_val_if_fail (script, FALSE); - JSStringRef js_script = JSStringCreateWithUTF8CString (script); - JSValueRef js_exception = NULL; - JSValueRef js_value = JSEvaluateScript (js_context, js_script, + js_script = JSStringCreateWithUTF8CString (script); + js_value = JSEvaluateScript (js_context, js_script, JSContextGetGlobalObject (js_context), NULL, 0, &js_exception); JSStringRelease (js_script); @@ -793,7 +795,6 @@ sokoke_xfce_header_new (const gchar* icon, if (sokoke_get_desktop () == SOKOKE_DESKTOP_XFCE) { GtkWidget* entry; - GtkStyle* style; gchar* markup; GtkWidget* xfce_heading; GtkWidget* hbox; @@ -804,9 +805,7 @@ sokoke_xfce_header_new (const gchar* icon, xfce_heading = gtk_event_box_new (); entry = gtk_entry_new (); - style = gtk_widget_get_style (entry); - gtk_widget_modify_bg (xfce_heading, GTK_STATE_NORMAL, - &style->base[GTK_STATE_NORMAL]); + hbox = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); if (icon) @@ -816,8 +815,6 @@ sokoke_xfce_header_new (const gchar* icon, GTK_ICON_SIZE_DIALOG); gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); label = gtk_label_new (NULL); - gtk_widget_modify_fg (label, GTK_STATE_NORMAL - , &style->text[GTK_STATE_NORMAL]); markup = g_strdup_printf ("%s", title); gtk_label_set_markup (GTK_LABEL (label), markup); @@ -826,6 +823,16 @@ sokoke_xfce_header_new (const gchar* icon, g_free (markup); gtk_widget_destroy (entry); + #if !GTK_CHECK_VERSION (3, 0, 0) + { + GtkStyle* style = gtk_widget_get_style (entry); + gtk_widget_modify_bg (xfce_heading, GTK_STATE_NORMAL, + &style->base[GTK_STATE_NORMAL]); + gtk_widget_modify_fg (label, GTK_STATE_NORMAL + , &style->text[GTK_STATE_NORMAL]); + } + #endif + vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), xfce_heading, FALSE, FALSE, 0);