Commit 709f323
committed
[GTK4] Implement correct moveAbove()/moveBelow() control behavior
Regardless of which control are given as input parameters, the controls
are currently always added as last child to their parents. Underlying
issue seems to be that the swt_fixed_restack() method does not handle
the GTK4 widgets correctly. As a solution, perform the movement using
the proper API.
To understand the combination in which GTK methods need to be called,
consider the expected behavior based on the GTK and SWT documentation:
[GTK4 Documentation]
- gtk_widget_insert_after(widget, parent, previous_sibling)
It will be placed after previous_sibling, or at the beginning if
previous_sibling is NULL.
- gtk_widget_insert_before(widget, parent, next_sibling)
It will be placed before next_sibling, or at the end if next_sibling
is NULL.
[SWT Documentation]
- moveAbove(control)
Moves the receiver above the specified control in the drawing order.
If the argument is null, then the receiver is moved to the top of the
drawing order
This means that if the specified control is NULL,
gtk_widget_insert_after(...) needs to be called, otherwise
gtk_widget_insert_before(...).
- moveBelow(control)
Moves the receiver below the specified control in the drawing order.
If the argument is null, then the receiver is moved to the bottom of
the drawing order.
Here the inverse applies. If the specified control is NULL,
gtk_widget_insert_before(...) needs to be called, otherwise
gtk_widget_insert_after(...).1 parent 3e8da4a commit 709f323
File tree
4 files changed
+52
-2
lines changed- bundles/org.eclipse.swt
- Eclipse SWT PI/gtk
- library
- org/eclipse/swt/internal/gtk4
- Eclipse SWT/gtk/org/eclipse/swt/widgets
4 files changed
+52
-2
lines changedLines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2083 | 2083 | | |
2084 | 2084 | | |
2085 | 2085 | | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
2086 | 2106 | | |
2087 | 2107 | | |
2088 | 2108 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
652 | 664 | | |
653 | 665 | | |
654 | 666 | | |
| |||
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1353 | 1353 | | |
1354 | 1354 | | |
1355 | 1355 | | |
1356 | | - | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1357 | 1365 | | |
1358 | 1366 | | |
1359 | 1367 | | |
| |||
1364 | 1372 | | |
1365 | 1373 | | |
1366 | 1374 | | |
1367 | | - | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
1368 | 1384 | | |
1369 | 1385 | | |
1370 | 1386 | | |
| |||
0 commit comments