fl_linux_window_manager 1.2.0 copy "fl_linux_window_manager: ^1.2.0" to clipboard
fl_linux_window_manager: ^1.2.0 copied to clipboard

PlatformLinux

Manage platform window of flutter application on linux

Flutter Linux Window Manager (FLWM) #

A flutter plugin that can be used to manage windows in linux platform. The plugin's main intension is make flutter suitable for the development of shells for linux window managers (e.g: GNOME Shell).

All necessary features needed to create panels and other shell components using flutter are provided in this plugin.

Usage #

  1. To use this plugin, first add this plugin to your application dependencies.
fl_linux_window_manager:
  git:
    url: git@github.com:moduluz-io/fl-linux-window-manager.git
  1. Open the my_application.cc from your flutter app's linux folder
  2. Import the required header files at the top of this file
#include <fl_linux_window_manager/fl_linux_window_manager_plugin.h>
  1. If you want to make the initial window of the app as a wayland layer, then add the code given below just before the gtk_widget_show(GTK_WIDGET(window)); line.
FLWM::WindowManager::convertToLayer(GTK_WINDOW(window));
  1. For all other property changes for the main window, create new window, etc. you can use the Dart API of this plugin.

Troubleshooting #

Layer is not enabled when running in debug mode on VSCode. #

If you are running VS Code as an X11 window, then the environment variable GDK_BACKEND will be set to x11. This environment variable is used by GTK to determine if it renders the window as a wayland surface or not.

To fix the problem:

  • Open your main.cc file in linux folder.
  • Add the below include statement
#include <stdlib.h>
  • Add the code given below to change the env variable and force GTK to use wayland backend. This code must be added at the beginning of main() function.
setenv("GDK_BACKEND", "wayland", 1);
4
likes
160
points
28
downloads

Publisher

verified publishermoduluz.io

Weekly Downloads

Manage platform window of flutter application on linux

Homepage
Repository (GitHub)
View/report issues

Topics

#linux #window #wayland #layer

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on fl_linux_window_manager