mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
Forward un/map events to NSGLView
This commit is contained in:
parent
c0828792f0
commit
60a0b8f645
4 changed files with 64 additions and 2 deletions
|
|
@ -1111,6 +1111,35 @@ GtkCanvas::on_leave_notify_event (GdkEventCrossing* ev)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
GtkCanvas::on_map ()
|
||||||
|
{
|
||||||
|
Gtk::EventBox::on_map();
|
||||||
|
#ifdef __APPLE__
|
||||||
|
if (_nsglview) {
|
||||||
|
Gtkmm2ext::nsglview_set_visible (_nsglview, true);
|
||||||
|
Gtk::Allocation a = get_allocation();
|
||||||
|
gint xx, yy;
|
||||||
|
gtk_widget_translate_coordinates(
|
||||||
|
GTK_WIDGET(gobj()),
|
||||||
|
GTK_WIDGET(get_toplevel()->gobj()),
|
||||||
|
0, 0, &xx, &yy);
|
||||||
|
Gtkmm2ext::nsglview_resize (_nsglview, xx, yy, a.get_width(), a.get_height());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
GtkCanvas::on_unmap ()
|
||||||
|
{
|
||||||
|
Gtk::EventBox::on_unmap();
|
||||||
|
#ifdef __APPLE__
|
||||||
|
if (_nsglview) {
|
||||||
|
Gtkmm2ext::nsglview_set_visible (_nsglview, false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/** Called to request a redraw of our canvas.
|
/** Called to request a redraw of our canvas.
|
||||||
* @param area Area to redraw, in window coordinates.
|
* @param area Area to redraw, in window coordinates.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,8 @@ public:
|
||||||
bool on_motion_notify_event (GdkEventMotion *);
|
bool on_motion_notify_event (GdkEventMotion *);
|
||||||
bool on_enter_notify_event (GdkEventCrossing*);
|
bool on_enter_notify_event (GdkEventCrossing*);
|
||||||
bool on_leave_notify_event (GdkEventCrossing*);
|
bool on_leave_notify_event (GdkEventCrossing*);
|
||||||
|
void on_map();
|
||||||
|
void on_unmap();
|
||||||
|
|
||||||
void on_realize ();
|
void on_realize ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -472,6 +472,35 @@ CairoWidget::on_realize ()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CairoWidget::on_map ()
|
||||||
|
{
|
||||||
|
Gtk::EventBox::on_map();
|
||||||
|
#ifdef __APPLE__
|
||||||
|
if (_nsglview) {
|
||||||
|
Gtkmm2ext::nsglview_set_visible (_nsglview, true);
|
||||||
|
Gtk::Allocation a = get_allocation();
|
||||||
|
gint xx, yy;
|
||||||
|
gtk_widget_translate_coordinates(
|
||||||
|
GTK_WIDGET(gobj()),
|
||||||
|
GTK_WIDGET(get_toplevel()->gobj()),
|
||||||
|
0, 0, &xx, &yy);
|
||||||
|
Gtkmm2ext::nsglview_resize (_nsglview, xx, yy, a.get_width(), a.get_height());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CairoWidget::on_unmap ()
|
||||||
|
{
|
||||||
|
Gtk::EventBox::on_unmap();
|
||||||
|
#ifdef __APPLE__
|
||||||
|
if (_nsglview) {
|
||||||
|
Gtkmm2ext::nsglview_set_visible (_nsglview, false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CairoWidget::on_state_changed (Gtk::StateType)
|
CairoWidget::on_state_changed (Gtk::StateType)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,8 @@ protected:
|
||||||
void on_realize ();
|
void on_realize ();
|
||||||
bool on_button_press_event (GdkEventButton*);
|
bool on_button_press_event (GdkEventButton*);
|
||||||
Gdk::Color get_parent_bg ();
|
Gdk::Color get_parent_bg ();
|
||||||
|
void on_map();
|
||||||
|
void on_unmap();
|
||||||
|
|
||||||
/* this is an additional virtual "on_..." method. Glibmm does not
|
/* this is an additional virtual "on_..." method. Glibmm does not
|
||||||
provide a direct signal for name changes, so this acts as a proxy.
|
provide a direct signal for name changes, so this acts as a proxy.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue