View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0030385 | Lazarus | Widgetset | public | 2016-07-18 15:57 | 2020-10-23 08:17 |
Reporter | Anton Kavalenka | Assigned To | Mattias Gaertner | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86_64 GTK2 | OS | Debian GNU/Linux | ||
Product Version | 1.7 (SVN) | ||||
Summary | 0030385: gtk2: Setting the form shape requires at least one TWinControl on form | ||||
Description | Documentation http://wiki.lazarus.freepascal.org/LCL_Tips#Creating_a_non-rectangular_window_or_control says - just call set SetWindowRgn(Handle,Rgn,true) on form Handle or call SetShape(HRGN) and will get a shaped form GTK2 widgetset relies on presence in Widget structure non-null field .Window to set the form region properly Window := GetControlWindow(Widget); if Window = nil then Exit(0); | ||||
Steps To Reproduce | Run the attached test. Should be round-corner shaped form. Reparent all the controls to the Form from the TPanel, run the test - Form become generic rectangular-shaped | ||||
Tags | No tags attached. | ||||
Fixed in Revision | r63897, 64054. | ||||
LazTarget | - | ||||
Widgetset | GTK 2 | ||||
Attached Files |
|
related to | 0037073 | closed | Mattias Gaertner | gtk2: SVN r63143 broke setting the form shape |
related to | 0037924 | closed | Juha Manninen | GTK "critical" messages generated by TabControl Tabs |
|
|
|
Reproducibility => always |
|
If the test application is wrong as mentioned in related 0030385 then please remove it. |
|
Obvious fix provided with new test application. gtk2region.diff (461 bytes)
Index: lcl/interfaces/gtk2/gtk2proc.inc =================================================================== --- lcl/interfaces/gtk2/gtk2proc.inc (revision 63883) +++ lcl/interfaces/gtk2/gtk2proc.inc (working copy) @@ -4067,6 +4067,7 @@ begin if Widget <> nil then begin + gtk_widget_realize(Widget); // associate with window If not GTKWidgetIsA(PGTKWidget(Widget), GTK_Layout_Get_Type) then Result := PGTKWidget(Widget)^.Window else |
|
ping @Juha Manninen |
|
Applied, thanks. |
|
Improved. |
|
r64050 does not work |
|
Patch based on recent findings See https://bugs.freepascal.org/view.php?id=37924#c126440 gtk2winrgn.diff (581 bytes)
Index: lcl/interfaces/gtk2/gtk2winapi.inc =================================================================== --- lcl/interfaces/gtk2/gtk2winapi.inc (revision 64053) +++ lcl/interfaces/gtk2/gtk2winapi.inc (working copy) @@ -9411,7 +9411,8 @@ end; if Widget = nil then Exit(0); - if GTKWidgetIsA(Widget, GTK_Layout_Get_Type) then + if GtkWidgetIsA(gtk_widget_get_toplevel(Widget), gtk_window_get_type) and + not gtk_widget_realized(Widget) then gtk_widget_realize(Widget); // associate with window Window := GetControlWindow(Widget); if Window = nil then |
|
Thanks! Applied. |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-07-18 15:57 | Anton Kavalenka | New Issue | |
2016-07-18 15:57 | Anton Kavalenka | File Added: laztest91.zip | |
2016-07-18 15:58 | Anton Kavalenka | Note Added: 0093756 | |
2020-05-15 23:47 | Juha Manninen | Relationship added | related to 0037073 |
2020-05-15 23:59 | Juha Manninen | Note Added: 0122828 | |
2020-05-16 00:00 | Juha Manninen | Reproducibility | have not tried => always |
2020-05-16 00:00 | Juha Manninen | LazTarget | => - |
2020-05-16 00:00 | Juha Manninen | Widgetset | GTK 2 => GTK 2 |
2020-09-17 08:41 | Anton Kavalenka | Note Added: 0125587 | |
2020-09-17 08:41 | Anton Kavalenka | File Added: gtk2region.diff | |
2020-09-17 08:41 | Anton Kavalenka | File Added: laztest118.zip | |
2020-09-20 08:40 | Anton Kavalenka | Note Added: 0125651 | |
2020-09-20 08:52 | Juha Manninen | Assigned To | => Juha Manninen |
2020-09-20 08:52 | Juha Manninen | Status | new => assigned |
2020-09-20 11:57 | Juha Manninen | Status | assigned => resolved |
2020-09-20 11:57 | Juha Manninen | Resolution | open => fixed |
2020-09-20 11:57 | Juha Manninen | Fixed in Revision | => r63897 |
2020-09-20 11:57 | Juha Manninen | Widgetset | GTK 2 => GTK 2 |
2020-09-20 11:57 | Juha Manninen | Note Added: 0125655 | |
2020-09-21 09:12 | Anton Kavalenka | Status | resolved => closed |
2020-10-14 15:53 | Juha Manninen | Relationship added | related to 0037924 |
2020-10-22 16:50 | Mattias Gaertner | Note Added: 0126461 | |
2020-10-22 18:05 | Anton Kavalenka | Status | closed => assigned |
2020-10-22 18:05 | Anton Kavalenka | Resolution | fixed => open |
2020-10-22 18:05 | Anton Kavalenka | Note Added: 0126466 | |
2020-10-22 18:11 | Anton Kavalenka | Note Added: 0126467 | |
2020-10-22 18:11 | Anton Kavalenka | File Added: gtk2winrgn.diff | |
2020-10-22 18:11 | Anton Kavalenka | Note Edited: 0126467 | View Revisions |
2020-10-22 20:29 | Mattias Gaertner | Assigned To | Juha Manninen => Mattias Gaertner |
2020-10-22 20:31 | Mattias Gaertner | Status | assigned => resolved |
2020-10-22 20:31 | Mattias Gaertner | Resolution | open => fixed |
2020-10-22 20:31 | Mattias Gaertner | Fixed in Revision | r63897 => r63897, 64054. |
2020-10-22 20:31 | Mattias Gaertner | Widgetset | GTK 2 => GTK 2 |
2020-10-22 20:31 | Mattias Gaertner | Note Added: 0126469 | |
2020-10-23 08:17 | Anton Kavalenka | Status | resolved => closed |