Skip to content

Commit 312c351

Browse files
committed
Remove explicit window manager initialization function
Eliminates the native_window_manager_initialize function and its usage, as initialization is now handled automatically on first use. Updates example code and header documentation to reflect this change.
1 parent 850111c commit 312c351

File tree

4 files changed

+1
-28
lines changed

4 files changed

+1
-28
lines changed

examples/application_c_example/main.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ int main() {
3838
return 1;
3939
}
4040

41-
// Initialize the application
42-
if (!native_application_initialize(app)) {
43-
fprintf(stderr, "Failed to initialize application\n");
44-
return 1;
45-
}
46-
47-
printf("Application initialized successfully\n");
41+
printf("Application instance obtained successfully\n");
4842
printf("Single instance: %s\n",
4943
native_application_is_single_instance(app) ? "Yes" : "No");
5044

examples/window_c_example/main.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,6 @@ native_menu_t create_context_menu(void) {
338338
}
339339

340340
int main() {
341-
// Initialize managers
342-
native_window_manager_initialize();
343-
344341
// Create a new window with options
345342
native_window_options_t* options = native_window_options_create();
346343
native_window_options_set_title(options, "Window Example");

src/capi/window_manager_c.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -281,17 +281,6 @@ bool native_window_manager_unregister_event_callback(int registration_id) {
281281
return true;
282282
}
283283

284-
FFI_PLUGIN_EXPORT
285-
bool native_window_manager_initialize(void) {
286-
try {
287-
// Access the singleton to ensure it's initialized
288-
WindowManager::GetInstance();
289-
return true;
290-
} catch (...) {
291-
return false;
292-
}
293-
}
294-
295284
FFI_PLUGIN_EXPORT
296285
void native_window_manager_shutdown(void) {
297286
std::lock_guard<std::mutex> lock(g_callback_mutex);

src/capi/window_manager_c.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,6 @@ int native_window_manager_register_event_callback(native_window_event_callback_t
111111
FFI_PLUGIN_EXPORT
112112
bool native_window_manager_unregister_event_callback(int registration_id);
113113

114-
/**
115-
* Initialize the window manager (called automatically on first use)
116-
* @return true on success, false on failure
117-
*/
118-
FFI_PLUGIN_EXPORT
119-
bool native_window_manager_initialize(void);
120-
121114
/**
122115
* Shutdown the window manager and cleanup resources
123116
*/

0 commit comments

Comments
 (0)