Skip to content

Commit 7fd3fd6

Browse files
committed
[Gtk4] Fix draw order
Snapshot children before applying custom draw.
1 parent 04310be commit 7fd3fd6

File tree

1 file changed

+4
-3
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+4
-3
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,14 +1719,15 @@ static long rendererClassInitProc (long g_class, long class_data) {
17191719

17201720
void snapshotDrawProc(long handle, long snapshot) {
17211721
Display display = getCurrent ();
1722-
Widget widget = display.getWidget (handle);
1723-
if (widget != null) widget.snapshotToDraw(handle, snapshot);
17241722
long child = GTK4.gtk_widget_get_first_child(handle);
1725-
// Propagate the snapshot down the widget tree
1723+
// Propagate the snapshot down the widget tree first
17261724
while (child != 0) {
17271725
GTK4.gtk_widget_snapshot_child(handle, child, snapshot);
17281726
child = GTK4.gtk_widget_get_next_sibling(child);
17291727
}
1728+
// Draw custom paint on top of children
1729+
Widget widget = display.getWidget (handle);
1730+
if (widget != null) widget.snapshotToDraw(handle, snapshot);
17301731
}
17311732

17321733
static long rendererGetPreferredWidthProc (long cell, long handle, long minimun_size, long natural_size) {

0 commit comments

Comments
 (0)