added file
[ardour.git] / libs / gtkmm2ext / gtk_ui.cc
index 2e130f066eacbbd0090085801edd551af8dc2066..660ea32ad1aa2a4b0142a702350b92eb851cf7d3 100644 (file)
@@ -114,7 +114,7 @@ UI::caller_is_ui_thread ()
 }
 
 int
-UI::load_rcfile (string path)
+UI::load_rcfile (string path, bool themechange)
 {
        if (path.length() == 0) {
                return -1;
@@ -129,6 +129,13 @@ UI::load_rcfile (string path)
        }
        
        RC rc (path.c_str());
+       // RC::reset_styles (Gtk::Settings::get_default());
+       gtk_rc_reset_styles (gtk_settings_get_default());
+       theme_changed.emit();
+
+       if (themechange) {
+               return 0; //Don't continue on every time there is a theme change
+       }
 
        /* have to pack widgets into a toplevel window so that styles will stick */
 
@@ -199,11 +206,6 @@ UI::load_rcfile (string path)
        info_mtag->property_foreground_gdk().set_value(style->get_fg(STATE_NORMAL));
        info_mtag->property_background_gdk().set_value(style->get_bg(STATE_NORMAL));
 
-
-       RC::reset_styles(Gtk::Settings::get_default());
-       
-       theme_changed.emit();
-
        return 0;
 }
 
@@ -412,7 +414,7 @@ UI::process_error_message (Transmitter::Channel chn, const char *str)
        RefPtr<Style> style;
        RefPtr<TextBuffer::Tag> ptag;
        RefPtr<TextBuffer::Tag> mtag;
-       char *prefix;
+       const char *prefix;
        size_t prefix_len;
        bool fatal_received = false;
 #ifndef OLD_STYLE_ERRORS
@@ -578,7 +580,7 @@ UI::flush_pending ()
 bool
 UI::just_hide_it (GdkEventAny *ev, Window *win)
 {
-       win->hide_all ();
+       win->hide ();
        return true;
 }