@@ -37,9 +37,8 @@ int Process::gui$create_window(const GUI_CreateWindowParameters* user_params)
37
37
return -EFAULT;
38
38
39
39
auto params = *user_params;
40
- Rect rect { params.rect .x , params.rect .y , params.rect .width , params.rect .height };
41
40
42
- if (rect.is_empty ())
41
+ if (params. rect .is_empty ())
43
42
return -EINVAL;
44
43
45
44
ProcessPagingScope scope (EventLoop::main ().server_process ());
@@ -52,14 +51,14 @@ int Process::gui$create_window(const GUI_CreateWindowParameters* user_params)
52
51
m_windows.append (window->makeWeakPtr ());
53
52
54
53
window->setTitle (params.title );
55
- window->setRect (rect);
54
+ window->setRect (params. rect );
56
55
57
56
auto * main_widget = new Widget;
58
57
window->setMainWidget (main_widget);
59
- main_widget->setWindowRelativeRect ({ 0 , 0 , rect.width (), rect.height () });
58
+ main_widget->setWindowRelativeRect ({ 0 , 0 , params. rect .width (), params. rect .height () });
60
59
main_widget->setBackgroundColor (params.background_color );
61
60
main_widget->setFillWithBackgroundColor (true );
62
- dbgprintf (" %s<%u> gui$create_window: %d with rect {%d,%d %dx%d}\n " , name ().characters (), pid (), window_id, rect.x (), rect.y (), rect.width (), rect.height ());
61
+ dbgprintf (" %s<%u> gui$create_window: %d with rect {%d,%d %dx%d}\n " , name ().characters (), pid (), window_id, params. rect .x (), params. rect .y (), params. rect .width (), params. rect .height ());
63
62
64
63
return window_id;
65
64
}
@@ -92,9 +91,8 @@ int Process::gui$create_widget(int window_id, const GUI_CreateWidgetParameters*
92
91
auto & window = *m_windows[window_id];
93
92
94
93
auto params = *user_params;
95
- Rect rect { params.rect .x , params.rect .y , params.rect .width , params.rect .height };
96
94
97
- if (rect.is_empty ())
95
+ if (params. rect .is_empty ())
98
96
return -EINVAL;
99
97
100
98
Widget* widget = nullptr ;
@@ -112,10 +110,10 @@ int Process::gui$create_widget(int window_id, const GUI_CreateWidgetParameters*
112
110
int widget_id = m_widgets.size ();
113
111
m_widgets.append (widget->makeWeakPtr ());
114
112
115
- widget->setWindowRelativeRect (rect);
113
+ widget->setWindowRelativeRect (params. rect );
116
114
widget->setBackgroundColor (params.background_color );
117
115
widget->setFillWithBackgroundColor (params.opaque );
118
- dbgprintf (" %s<%u> gui$create_widget: %d with rect {%d,%d %dx%d}\n " , name ().characters (), pid (), widget_id, rect.x (), rect.y (), rect.width (), rect.height ());
116
+ dbgprintf (" %s<%u> gui$create_widget: %d with rect {%d,%d %dx%d}\n " , name ().characters (), pid (), widget_id, params. rect .x (), params. rect .y (), params. rect .width (), params. rect .height ());
119
117
120
118
return window_id;
121
119
}
0 commit comments