diff options
author | David Robillard <d@drobilla.net> | 2008-02-16 22:43:18 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-16 22:43:18 +0000 |
commit | 8aa9508c82f32efcf9c7c00e2c9e76268d4dddce (patch) | |
tree | 1fb1a5e7eef6684c0a5bb49be492612c71796fc4 /gtk2_ardour/splash.cc | |
parent | 1b657585572298d1a69a7b43e611f59b7e185df3 (diff) |
Merge with 2.0-ongoing R3071.
git-svn-id: svn://localhost/ardour2/branches/3.0@3073 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/splash.cc')
-rw-r--r-- | gtk2_ardour/splash.cc | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index e901521e37..893ecc3d2c 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -5,6 +5,7 @@ #include <ardour/ardour.h> #include <ardour/filesystem_paths.h> +#include "gui_thread.h" #include "splash.h" #include "i18n.h" @@ -36,6 +37,7 @@ Splash::Splash () set_keep_above (true); set_position (WIN_POS_CENTER); darea.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); + darea.set_double_buffered (false); layout = create_pango_layout (""); string str = "<b>"; @@ -50,7 +52,10 @@ Splash::Splash () add (darea); + set_default_size (pixbuf->get_width(), pixbuf->get_height()); the_splash = this; + + ARDOUR::BootMessage.connect (mem_fun (*this, &Splash::boot_message)); } void @@ -80,12 +85,17 @@ Splash::expose (GdkEventExpose* ev) { RefPtr<Gdk::Window> window = darea.get_window(); + /* note: height & width need to be constrained to the pixbuf size + in case a WM provides us with a screwy allocation + */ + window->draw_pixbuf (get_style()->get_bg_gc (STATE_NORMAL), pixbuf, ev->area.x, ev->area.y, ev->area.x, ev->area.y, - ev->area.width, ev->area.height, + min ((pixbuf->get_width() - ev->area.x), ev->area.width), + min ((pixbuf->get_height() - ev->area.y), ev->area.height), Gdk::RGB_DITHER_NONE, 0, 0); - + Glib::RefPtr<Gtk::Style> style = darea.get_style(); Glib::RefPtr<Gdk::GC> white = style->get_white_gc(); @@ -95,6 +105,12 @@ Splash::expose (GdkEventExpose* ev) } void +Splash::boot_message (std::string msg) +{ + message (msg); +} + +void Splash::message (const string& msg) { string str ("<b>"); @@ -103,5 +119,10 @@ Splash::message (const string& msg) layout->set_markup (str); darea.queue_draw (); - get_window()->process_updates (true); + + Glib::RefPtr<Gdk::Window> win = darea.get_window(); + if (win) { + win->process_updates (true); + gdk_flush (); + } } |