From: Yuuki Harano Date: Mon, 6 Dec 2021 15:46:39 +0000 (+0900) Subject: Merge branch 'feature/pgtk' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk X-Git-Tag: emacs-29.0.90~3612 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0b6a632f99214e2d1e9e1d72b8f8b3a7f054d552;p=emacs.git Merge branch 'feature/pgtk' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk --- 0b6a632f99214e2d1e9e1d72b8f8b3a7f054d552 diff --cc src/pgtkterm.c index 4bfe2efbdc5,7af4e3783ab..1e8d49c1d1b --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@@ -798,13 -798,7 +798,14 @@@ x_set_parent_frame (struct frame *f, Li gtk_widget_get_allocation (fixed, &alloc); g_object_ref (fixed); + /* Remember the css provider, and restore it later. */ GtkCssProvider *provider = FRAME_X_OUTPUT (f)->border_color_css_provider; + FRAME_X_OUTPUT (f)->border_color_css_provider = NULL; + { + GtkStyleContext *ctxt = gtk_widget_get_style_context (FRAME_WIDGET (f)); - gtk_style_context_remove_provider (ctxt, GTK_STYLE_PROVIDER (provider)); ++ if (provider != NULL) ++ gtk_style_context_remove_provider (ctxt, GTK_STYLE_PROVIDER (provider)); + } { GtkWidget *whbox_of_f = gtk_widget_get_parent (fixed); @@@ -846,17 -843,10 +847,20 @@@ gtk_widget_show_all (fixed); } + /* Restore css provider. */ GtkStyleContext *ctxt = gtk_widget_get_style_context (FRAME_WIDGET (f)); - if (provider) - gtk_style_context_add_provider (ctxt, GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); + GtkCssProvider *old = FRAME_X_OUTPUT (f)->border_color_css_provider; + FRAME_X_OUTPUT (f)->border_color_css_provider = provider; - gtk_style_context_add_provider (ctxt, GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); ++ if (provider != NULL) ++ { ++ gtk_style_context_add_provider (ctxt, GTK_STYLE_PROVIDER (provider), ++ GTK_STYLE_PROVIDER_PRIORITY_USER); ++ } + if (old != NULL) + { + gtk_style_context_remove_provider (ctxt, GTK_STYLE_PROVIDER (old)); + g_object_unref(old); + } g_object_unref (fixed);