{"id":15489136,"url":"https://github.com/alexmercerind/window_plus","last_synced_at":"2025-04-14T12:41:54.982Z","repository":{"id":65539514,"uuid":"540138899","full_name":"alexmercerind/window_plus","owner":"alexmercerind","description":"As it should be. Extend view into title-bar.","archived":false,"fork":false,"pushed_at":"2025-04-09T18:36:08.000Z","size":1741,"stargazers_count":38,"open_issues_count":2,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T19:39:31.295Z","etag":null,"topics":["custom-window-chrome","custom-window-frame","flutter","frameless-window","linux","window-customization","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexmercerind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-22T19:28:25.000Z","updated_at":"2025-04-09T18:36:13.000Z","dependencies_parsed_at":"2025-04-09T19:28:37.935Z","dependency_job_id":"f83e505a-b92d-4e24-a9c4-eaa7420f97b9","html_url":"https://github.com/alexmercerind/window_plus","commit_stats":{"total_commits":131,"total_committers":2,"mean_commits":65.5,"dds":"0.10687022900763354","last_synced_commit":"aafcf5fec19d469c6cc23741e2677aa06b493c5b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmercerind%2Fwindow_plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmercerind%2Fwindow_plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmercerind%2Fwindow_plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmercerind%2Fwindow_plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexmercerind","download_url":"https://codeload.github.com/alexmercerind/window_plus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248883120,"owners_count":21177158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-window-chrome","custom-window-frame","flutter","frameless-window","linux","window-customization","windows"],"created_at":"2024-10-02T07:03:55.451Z","updated_at":"2025-04-14T12:41:54.954Z","avatar_url":"https://github.com/alexmercerind.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [window+](https://github.com/alexmercerind/window_plus)\n\n\u003e Work in progress. API may change.\n\nAs it should be. Extend view into title-bar.\n\n## Setup\n\nFollowing configuration is required.\n\n### macOS\n\nEdit `macos/Runner/MainFlutterWindow.swift` as:\n\n```diff\n import Cocoa\n import FlutterMacOS\n+import window_plus\n \n class MainFlutterWindow: NSWindow {\n     override func awakeFromNib() {\n        WindowPlusPlugin.handleSingleInstance()\n \n         let flutterViewController = FlutterViewController()\n         let windowFrame = self.frame\n         self.contentViewController = flutterViewController\n         self.setFrame(windowFrame, display: true)\n \n         RegisterGeneratedPlugins(registry: flutterViewController)\n \n         super.awakeFromNib()\n     }\n \n+    override public func order(_ place: NSWindow.OrderingMode, relativeTo otherWin: Int) {\n+        super.order(place, relativeTo: otherWin)\n+        WindowPlusPlugin.hideUntilReady()\n+    }\n }\n```\n\n### Windows\n\nEdit `windows/runner/win32_window.cpp` as:\n\n```diff\n   HWND window = CreateWindow(\n-      window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE,\n+      window_class, title.c_str(), WS_OVERLAPPEDWINDOW,\n       Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),\n       Scale(size.width, scale_factor), Scale(size.height, scale_factor),\n       nullptr, nullptr, GetModuleHandle(nullptr), this);\n```\n\n```diff\n-    case WM_SIZE: {\n-      RECT rect = GetClientArea();\n-      if (child_content_ != nullptr) {\n-        // Size and position the child window.\n-        MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,\n-                   rect.bottom - rect.top, TRUE);\n-      }\n-      return 0;\n-    }\n\n     case WM_ACTIVATE:\n```\n\n### Linux\n\nEdit `linux/my_application.cc` as:\n\n```diff\n   FlView* view = fl_view_new(project);\n   gtk_widget_show(GTK_WIDGET(view));\n   gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));\n   fl_register_plugins(FL_PLUGIN_REGISTRY(view));\n-  gtk_widget_grab_focus(GTK_WIDGET(view));\n+  gtk_widget_hide(GTK_WIDGET(window));\n```\n\n## Single Instance\n\nFor enabling single instance support, follow the steps below.\n\n### macOS\n\nNo changes required.\n\n### Windows\n\nIn `windows/runner/main.cpp`, add the following code:\n\n```diff\n  #include \u003cflutter/dart_project.h\u003e\n  #include \u003cflutter/flutter_view_controller.h\u003e\n  #include \u003cwindows.h\u003e\n\n  #include \"flutter_window.h\"\n  #include \"utils.h\"\n+ #include \"window_plus/window_plus_plugin_c_api.h\"\n\n  int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,\n                        _In_ wchar_t* command_line, _In_ int show_command) {\n+   ::WindowPlusPluginCApiHandleSingleInstance(NULL, NULL);\n\n    // Attach to console when present (e.g., 'flutter run') or create a\n    // new console when running with a debugger.\n    if (!::AttachConsole(ATTACH_PARENT_PROCESS) \u0026\u0026 ::IsDebuggerPresent()) {\n      CreateAndAttachConsole();\n    }\n```\n\nIf you use custom window class name, then you can pass it as the first argument instead of `NULL`. Similarly, if you want to also account for your window's title, then you can pass it as the second argument instead of `NULL`.\n\n### Linux\n\nYou need to edit your `linux/my_application.cc` file. See [this file for reference](https://github.com/alexmercerind/window_plus/blob/master/example/linux/my_application.cc).\n\nNotice how `G_APPLICATION_HANDLES_OPEN` \u0026 `G_APPLICATION_HANDLES_COMMAND_LINE` [are implemented](https://github.com/alexmercerind/window_plus/blob/562407f7f316714024577ce5467a12ee8f99bc24/example/linux/my_application.cc#L135-L149).\n\nFinally, forward the arguments to Dart / Flutter, with [`window_plus_plugin_handle_single_instance` call at the required location](https://github.com/alexmercerind/window_plus/blob/562407f7f316714024577ce5467a12ee8f99bc24/example/linux/my_application.cc#L24-L31).\n\n## Platforms\n\n- macOS\n- Windows\n- GNU/Linux\n\n## License\n\nMIT License\n\nCopyright © 2022, Hitesh Kumar Saini \u003csaini123hitesh@gmail.com\u003e.\n\n_It's free real estate._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmercerind%2Fwindow_plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexmercerind%2Fwindow_plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmercerind%2Fwindow_plus/lists"}