fl_linux_window_manager 1.2.0
fl_linux_window_manager: ^1.2.0 copied to clipboard
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 #
- 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
- Open the
my_application.cc
from your flutter app'slinux
folder - Import the required header files at the top of this file
#include <fl_linux_window_manager/fl_linux_window_manager_plugin.h>
- 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));
- 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 inlinux
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);