- GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_LEAVE_NOTIFY_MASK);
- gtk_widget_show(fixed);
- gtk_widget_reparent(m_mainWidget, fixed);
- gtk_container_add((GtkContainer*)m_widget, fixed);
- gtk_fixed_move((GtkFixed*)fixed, m_mainWidget, m_miniEdge, m_miniTitle + m_miniEdge);
- g_signal_connect(fixed, "size_allocate", G_CALLBACK(size_allocate), this);
+ GDK_POINTER_MOTION_HINT_MASK);
+ gtk_widget_show(eventbox);
+ // Use a GtkAlignment to position m_mainWidget inside the decorations
+ GtkWidget* alignment = gtk_alignment_new(0, 0, 1, 1);
+ gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
+ m_miniTitle + m_miniEdge, m_miniEdge, m_miniEdge, m_miniEdge);
+ gtk_widget_show(alignment);
+ // The GtkEventBox and GtkAlignment go between m_widget and m_mainWidget
+ gtk_widget_reparent(m_mainWidget, alignment);
+ gtk_container_add(GTK_CONTAINER(eventbox), alignment);
+ gtk_container_add(GTK_CONTAINER(m_widget), eventbox);