Установка диспетчера окон kwin

Обновлено: 02.05.2024

The KWin mailing list is [email protected] . It's rather low traffic.

Bugzilla

KWin parts

KWin consists of several parts:

  • The KWin core, located in toplevel directory, which implements the window manager and compositor.
  • The decoration plugins, located in clients and kdeartwork/kwin-styles, which are responsible for the visual representation of the windows.
  • The effects plugins, located in effects/*, which are responsible for compositing effects
  • The libkdecorations library, located in libkdecorations/*, which is used for communication between the core and the decoration, and also implements some shared functionality for the decorations.
  • The libkwineffects library, located in libkwineffects/*, which is used for communication between the core and the effects and also implements some shared functionality for the effects and the compositor.
  • KControl modules, located in kcmkwin/*.
  • The KWin Scripting bindings for JavaScript and QtQuick are located in scripting/*
  • KWin Scripts in JavaScript and/or QtQuick are located in scripts/*
  • The Window and Desktop Switching framework is located in tabbox/*

KWin structure

KWin has relatively few classes. The two main classes are Client, which represents windows on the screen, and Workspace, which represents the whole screen and manages windows. Since KWin also needs to track unmanaged windows for compositing, there is a base class Toplevel for all windows, from which Client inherits, and from which also class Unmanaged inherits. A third inheriting class Deleted keeps a copy of the window pixmap for animation when a window is closed. These classes are rather large, because they fulfill complicated tasks. In order to reduce the size of their source files these some functionality is in a separate .cpp file grouped by their purpose. Lately, the functionality is getting split out of Workspace.

Window Manager

The following lists the source files relevant for the core of the window manager:

  • workspace.* - core of class Workspace
  • client.* - core of class Client
  • toplevel.* - core of the base class Toplevel
  • unmanaged.* - core of the class Unmanaged
  • activities.* - Functionality related to Activities
  • appmenu.* - Functionality for embedding the Application's menu into the window decoration
  • activation.cpp - focus handling and window activation
  • client_machine.* - detects whether a Client is on a local or on a remote system
  • cursor.* - Mouse cursor related functionality like mouse polling
  • deleted.* - core of class Deleted
  • dbusinterface.* - Implementation of KWin's DBus interface, delegating to other classes
  • events.cpp - event handling is in events.cpp
  • focuschain.* - The Focus Chain for each desktop and most recently used Clients
  • geometry.cpp - geometry-related code
  • layers.cpp - stacking-related code
  • manage.cpp - code dealing with new windows
  • netinfo.* - Implementation of KWin's sub calles for NETRootInfo and NETWinInfo
  • outline.* - code for showing an outline when e.g. using Alt+Tab or quicktiling
  • placement.cpp - window placements algorithms
  • rules.cpp - code for window-specific settings
  • screenedge.* - code for screen edge activation
  • screens.* - multi-screen handling code
  • sm.cpp - session management code
  • tabgroup.* - Window tabs related code
  • thumbnailitem.* - QML DeclarativeItem to render a Window Thumbnail (or Icon without Compositing)
  • useractions.* - handling of the Alt+F3 menu, shortcuts and other user actions
  • virtualdesktops.* - Functionality related to Virtual Desktops

Compositor

The following lists the source files relevant to the compositor:

  • composite.* - code related to redirecting windows to pixmaps and tracking their damage
  • effects.* - support for compositing effects
  • eglonxbackend.* - OpenGL backend using EGL for either OpenGL or OpenGL ES
  • egl_wayland_backend.* - OpenGL backend using EGL to render to a Wayland surface
  • glxbackend.* - OpenGL backend using GLX
  • lanczosfilter.* - Lanczos Filter for improved OpenGL based thumbnail rendering
  • overlaywindow.* - the Overlay Window used for Compositing
  • paintredierctor.* - Redirects painting of decoration widget into a paint device for usage by the Scenes
  • scene.* - base class for compositing backends, with shared functionality
  • scene_basic.* - a very simple testing compositing code
  • scene_opengl.* - compositing backed using OpenGL
  • scene_opengl_egl.cpp - egl specific part of OpenGL compositing backend
  • scene_opengl_glx.cpp - glx specific part of OpenGL compositing backend
  • scene_xrender.* - compositing backend using XRender
  • shadow.* - Window Shadows

The implementation of a custom scene can be found in KWin/Hacking/Scene.

Helper Classes

The rest of the files contain additional helper classes:

  • atoms.* - so-called atoms (symbolic names for constants in X)
  • bridge.* - communication with the decoration plugin
  • geometrytip.* - window displaying window geometry while moving/resizing
  • group.* - grouping related windows together (warning! This is currently really messy and scary code that should be rewritten).
  • killwindow.* - handling of the Ctrl+Esc feature
  • kwinbindings.cpp - KWin's keyboard shortcuts (used by kdebase/kcontrol/keys)
  • notifications.* - for KNotify
  • options.* - all configuration options for KWin are stored in this class
  • decorations.* - loading of the right decoration plugin
  • utils.* - various small utility functions/classes
  • xcbutils.* - wrapper classes for accessing XCB

KWin also uses code from kdelibs, specifically files netwm.cpp, netwm.h, netwm_def.h and netwm_p.h from kdelibs/kdecore. These files implement support for the EWMH window manager specification, originally called NETWM (hence the filenames).

KWin Decorations

If you want to develop a decoration plugin for KWin, you can use follow this HOWTO. The HOWTO does not include the latest changes in KDE 4. These plugins have to be written in C++.

If you prefer designing a theme, you can use Aurorae (shipped with KWin), deKorator or Smaragd. For Aurorae there is a tutorial on techbase and it is recommended to use AuroraeDesigner.

It is also possible to develop window decorations using QML. But the API is still considered unstable and because of that not yet documented. An example is the Plastik decoration since 4.10.

Developing KWin

Building KWin

Please see KWin/Building for Qt4 and KWin/Frameworks for Qt5

Restarting KWin

Since KWin takes care of focus handling, first killing KWin and then launching a new instance can cause focus trouble. Therefore it's possible to run 'kwin --replace', which will start a new KWin instance and tell the old one to quit.

Handling the case when KWin crashes

Again, without KWin running there may be focus problems. To restart KWin when not being able to focus KRunner or a Konsole switch to a text console, and run 'DISPLAY=:0 kwin --replace' (and then you can run 'kwin --replace' again from X).

If KWin is temporarily unusable because of some change and e.g. crashes during startup, it is possible to run another window manager, for example Metacity, Compiz, OpenBox or FVWM (the command is similar to restarting KWin, i.e. 'metacity --replace', 'compiz --replace', 'openbox --replace' or 'fvwm -replace'). A good idea is also to have the distribution's KWin around to be able to switch to this if the development version is broken.

Debugging KWin

Focus problems once more. It is not possible to debug KWin in gdb in the X session that KWin is managing, because that'd block focus and window operations. It is necessary to switch to a text console and attach to the running KWin instance from there, or launch it as 'DISPLAY=:0 gdb kwin'.

Since KWin is such an important component of KDE, it is usually better to start another X for development.

Starting separate X for testing KWin: use a separate user, login to a text console and run "( X vt10 :1 -terminate &); sleep 5; DISPLAY=:1 xterm". This launches another X with DISPLAY=:1 on virtual console 10 (Ctrl+Alt+F10) with xterm. Then it's normally possible to run just KWin or whole KDE with startkde (in which case it's a good idea to disable xterm from session management in KControl->KDE components->Session manager).

Another solution is to use Xephyr which allows having the KWin which is getting debugged on the same screen as the IDE. But some features are not available on Xephyr like OpenGL-based compositing.

Window manager spec

Notes

So, you feel brave, huh? But KWin is not THAT difficult. Some parts, especially the X-related ones, can be very complicated, but for many parts even knowledge of X and Xlib is not necessary. Most X code is wrapped in helper functions. However, although many features don't require touching X/Xlib directly, still X/Xlib may impose their semantics on the way things are done. When in doubt, simply ask.

All merge requests for KWin should be sent to GitLab for review first. Even seemingly harmless changes may have extensive consequences. For more information, see Infrastructure/GitLab.

in class Client and it will print information about the window.

  • KWin itself cannot create any normal windows, because it would have trouble managing its own windows. For such cases (which should be rare) a small external helper application is needed (kdialog should often do, and for special cases such a utility needs to be written like kwin/killer).

Coding style

The source repository was reformatted with git commit 4fd08556.

Submitting Changes

KWin development uses ReviewBoard for code review. Upload your change for the repository "kwin" (for 4.11 it's "kde-workspace") and add review group kwin.

Documentation

X documentation

OpenGL

KWin uses OpenGL for its compositor and in some effects. Most effects do not use OpenGL directly, so it is possible to write effects without the knowledge of OpenGL. If you want to directly manipulate the rendering scene or working on the Compositor itself you must have at least some basic knowledge about OpenGL.

OpenGL comes in two different flavors: fixed functionality and programmable pipeline. There are several versions of OpenGL. OpenGL 1.x only supports fixed functionality, OpenGL ES 2.0 and OpenGL 3/4 (forward compatible profile) only supports programmable pipeline. OpenGL 2.x supports both way of programming.

KWin has code paths for both fixed functionality and programmable pipeline. By default, KWin uses programmable pipeline and only falls back to fixed functionality if the GPU does not support it. New code should focus on programmable pipeline and restrict itself to the OpenGL ES 2.0 API.

Books

There are various books about OpenGL, documenting different bits of the API

    The online resource is the (outdated) 5th edition not covering OpenGL Shading Language. Even the 6th edition does only contain a small chapter on OpenGL Shading Language and the previous chapters are slightly outdated, too. Nevertheless it's a good book for learning the concepts of OpenGL, but does not help much on KWin development. a good book about OpenGL Shading Language. In the 2nd edition it was strongly focusing on extending the fixed functionality with some programmable states. It seems that in the 3rd edition it got updated to using only shaders. The examples might be too extensive for use in KWin. This is one of the best books for OpenGL development. The 4th edition has an extensive view on both fixed functionality as well as programmable pipeline. In the 5th edition fixed functionality has been completely removed and the book has been rewritten for programmable pipeline with OpenGL 3. The book is well structured and has a good teaching approach. One of the best features is the API documentation in the Appendix.

API Documentation

Finding the right API documentation for OpenGL is rather difficult. KWin uses in general functionality from OpenGL 2.1 but also uses some functionality provided by Extensions. The programmable pipeline code path should be compatible with OpenGL ES 2.0, this means it is not allowed to use fixed functionality API calls, even if listed in the OpenGL 2.1 reference pages.

    These man pages only document the core context. Complete OpenGL 2.1 API including GLX. This includes both fixed functionality and programmable pipeline. Do not use any API call only available since OpenGL 2.0 in the fixed functionality code path and do check whether an API call is still available in the OpenGL 3.3 core context for the programmable pipeline path Subset of OpenGL 2 for embedded devices. Best restrict to this API in the programmable pipeline path. Any API call not available in OpenGL ES 2.0 will fail when compiling against OpenGL ES.

This page was last edited on 22 June 2021, at 17:19. Content is available under Creative Commons License SA 4.0 unless otherwise noted.

Donate to KDE Why Donate?

Visit the KDE MetaStore

Show your love for KDE! Purchase books, mugs, apparel, and more to support KDE.

Установка диспетчера окон Kwin на Ubuntu 18.04

Kwin на Ubuntu 16.04 (XFCE, или MATE)

Установка диспетчера окон Kwin на Ubuntu 18.04 (XFCE, или MATE)

Введение:

Доброго времени суток дорогой пользователь Linux! В данной статье ты познакомишься с тем — как можно запустить диспетчер окон Kwin (да-да, тот самый который по умолчанию используется в рабочем окружении KDE) с рабочим окружением XFCE, или MATE.

Зачем он мне?

Вот основные преимущества из за которых я юзаю Kwin без кед (KDE), уже давно:

  • Не требователен к ресурсам, особенно если используется вместе с легковесным рабочим окружением
  • Красивый, удобный и очень гибкий в настройке (горячие клавиши и большое количество тем которые можно добавлять прямо из панели управления)
  • Убирает тиринг (разрывы изображения) при просмотре фильмов (такая проблема до сих пор осталась, например на чистом XFCE)
  • Не уменьшает ФПС в играх, так как в настройках можно отключить все эффекты для полноэкранных окон, что положительно влияет на производительность

На каких системах это работает

Лично я устанавливал и успешно запускал Kwin на Ubuntu-MATE 16.04 и на Xubuntu 16.04. Но насколько я знаю, его можно с таким же успехом завести на Lubuntu и Linux Mint (X-Cinnamon), но утверждать не могу. Если у вас удачно получилось завести данный диспетчер окон в других рабочих окружениях — прошу пишем в комментариях о ваших результатах…

Необходимые пакеты:

Для успешного использования диспетчера окон Kwin нам потребуется 3 основных пакета:

kwin (собственно сам диспетчер окон. КЭП =)

systemsettings (для легкой настройки самого менеджера окон)

Для «бубунтоподобных» систем устанавливаем все одной строкой в терминале:

sudo apt-get update && sudo apt install -y kwin systemsettings

Проверка и запуск

Мы теперь имеем все необходимое для запуска Kwin, ну давайте запустим его с помощью терминала:

Заработало?! Не пугайтесь, изначально настройки (мягко говоря) ужасные.

Настройка автозапуска

Что бы диспетчер окон запускался вместе с вашей ОС автоматически, необходимо данную команды (из предыдущего пункта) добавить в автозагрузку.

Например в XFCE делается это так: меню —> все настройки —> сеансы и запуск —> автозапуск —> добавить

Имя: Kwin WM

Описание: Менеджер окон Kwin из KDE

Команда: kwin --replace

и кликаем ОК. Готово!

Настройка эффектов и «красоты»

Переходим обратно, ко всем настройкам и находим новый пункт: Параметры системы KDE

Для удобства щелкаем сверху по «кнопке» Настроить и меняем Вид меню на Дерево

Дальше я думаю что вы и сами разберетесь и настроите менеджер окон Kwin на свой вкус.

OSU Linux

OSU Linux 02.01.2021 порт обновлен до версии 1.6 OSU! — игра которую можно легко запустить под Linux. Это порт для клиента OSU! под Linux на основе WINE. С удобным…

Изменения в Ubuntu 18.04 Состоялся релиз дистрибутива Ubuntu 18.04 «Bionic Beaver», который отнесён к категории выпусков с длительным сроком поддержки (LTS), обновления…

Aion Linux Aion Linux — компьютерная игра в жанре MMORPG, разработанная NCSoft, сочетающая в себе PvP и PvE в мире фэнтези. Особенности игры Полёты и сражения в воздухе Игроки…

FlashOS - Linux для игр

FlashOS — Linux для игр основанная на xubuntu 16.10 + XFCE + Kwin Сборка данной ОС перенесена на дистрибутив Manjaro Linux……

Kwin на Ubuntu 16.04 (XFCE, или MATE)

Установка диспетчера окон Kwin на Ubuntu 18.04 (XFCE, или MATE) Введение: Доброго времени суток дорогой пользователь Linux! В данной статье…

Отдельная X-сессия на ubuntu 18.04

Отдельная X-сессия на ubuntu 18.04 Введение: Друзья, раз Вы читаете данный пост, значит у Вас тоже проблемы с запуском…

Настройка Xubuntu 16.04 после установки

Настройка Xubuntu 16.04 после установки Привет! Как всем уже известно 21 апреля 2016 года, вышел релиз Ubuntu 16.04 и уже…


Содержание

Обзор возможностей

  • Стабильный и надежный
  • Композитный, с трёхмерными эффектами
  • Простота настройки
  • Улучшенная эффективность

KWin (произносится как "квин") — это диспетчер окон для рабочего стола KDE. Он даёт полный контроль над окнами, таким образом, чтобы помочь в решении ваших задач. Он отвечает за оформления окон, заголовок окна с (настраиваемыми) кнопками, такими как «закрыть», «распахнуть», «свернуть». Он также отвечает за размещение окон на рабочем столе и переключение между ними.

KWin поддерживает композитность, что означает использование трёхмерных эффектов при отрисовке окон. Это может сделать управление окнами более гладким, лёгким и более эффективным и естественным. Его аппаратные требования очень скромные, и почти каждая разумно современная система с 2002 года поддерживает его. Могут быть небольшие проблемы с некоторой аппаратурой, более подробно на эту тему можно узнать на странице KWin в TechBase.

Удобные возможности

Click with your right mouse button on a window decoration or use System Settings to access the new and easier configuration of KWin. Here you can enable effects to more efficiently manage your windows. You can for example use the Present Windows as the effect for window switching. Instead of showing you icons or very small previews of your applications, it arranges them in a grid so you can quickly choose the right one. Just use the Alt-Tab keysequence and keep the Alt key pressed. You can now use tab to switch through the windows or just activate the right one using the mouse. Hitting Alt-Tab keys quickly will show you the next window in the queue, just like it used to.

If your X server already supports compositing, switching it on is as easy as opening System Settings, opening the Worskpace Appearance and Behaviour module, choosing Desktop Effects and enabling the checkbox Enable desktop effects at startup . More advanced compositing settings (such as Use VSync, Scale method, Compositing type) are available through the Advanced dialog. Customising the behaviour of the KWin effects means opening the All effects tab, and choosing the plugins you want to use. Please note that only a subset of the plugins works with XRender-based compositing. For the full experience, you need to use OpenGL mode.

Employing motion physics, KWin provides your windows with a more natural feel. New desktop effects like the Cube desktop switcher and Magic Lamp minimize animation have been added. Improvements in the existing effects make window management smoother than ever. KWin has seen many performance improvements to enable these effects even on low-end hardware. Elaborate checks have been build in to ensure users with low-end hardware are not presented with an unusable setup. KWin detects the capabilities of the hardware and if needed gracefully scales its effects down. You can take control and disable these checks or change settings like the global animation speed to fine-tune your experience. When your computer is under heavy load, KWin will automatically disable the compositing temporarily to keep things running smoothly. It will notify you if it does so, and you can re-enable compositing by pressing Shift+Alt+F12 . Finally, support for multiple screen handling has been improved in KWin using the new Kephal library. You can move maximized windows between Xinerama screens and the addition of external screens is handled correctly.

More information about what was introduced in KDE SC 4.9 can be found at the following link:

Tutorials

You want an application to launch in a specific size and position every time


Sometimes the screen position of an application is vital to your comfort, so use the flexibility of KWin to make sure it's always where you want it.

Position the window where you want it to open, then right-click on the title-bar, choosing Advanced -> Special Window Settings . This will open a settings window, with appropriate entries already made. All you need to do now is select the Size & Position tab and check Position and Size . OK - you are finished!

Script the window manager from the command line

Настройка расположения кнопок заголовка окна

Перейдите к виду Параметры системы -> Внешний вид рабочего стола -> Оформление окон -> Настроить кнопки и включите переключатель «Использовать своё расположение кнопок заголовка окна». Доступные параметры могут зависеть от дистрибутива или используемой темы оформления.


To simply move things around you work with the specimen titlebar. Drag icons there to where you want to see them.

You may find that you have other icons available to you. A circle indicates that the button will set that window on all desktops. Another icon that you may find useful is Shade - a toggle between rolled up (titlebar only visible) and normal view. These icons are added by dragging from the text description window onto the speciman title bar - just position them as you want to use them.

Если вы предпочитаете классический рабочий стол в стиле KDE3

Щёлкните правой кнопкой на рабочем столе и выберите Настроить виджет «Рабочий стол». Измените тип с «Рабочий стол» на «Просмотр папки». Отныне рабочий стол стал просмотром папки и следующий щелчок правой кнопкой вызовет контекстное меню для просмотра папки. Установите просмотр папки на каталог, который вы хотите использовать как свой рабочий стол.


Содержание

Feature Overview

  • Stable and reliable
  • Compositing, 3D effects
  • Easy configuration
  • Improved efficiency

KWin (pronounced "kay-win") is the window manager for the KDE Plasma Desktop. It gives you complete control over your windows, making sure they're not in the way but aid you in your task. It paints the window decoration, the bar on top of every window with (configurable) buttons like close, maximize and minimize. It also handles placing of windows and switching between them.

KWin supports compositing, which means using 3D effects for handling your windows. This can make window management smoother, easier, more efficient and more natural. It’s hardware requirements are very modest and pretty much every reasonably modern system since 2002 supports it.

Practical Features

Click with your right mouse button on a window decoration or use System Settings to access the new and easier configuration of KWin. Here you can enable effects to more efficiently manage your windows. You can for example use the Present Windows as the effect for window switching. Instead of showing you icons or very small previews of your applications, it arranges them in a grid so you can quickly choose the right one. Just use the Alt-Tab keysequence and keep the Alt key pressed. You can now use tab to switch through the windows or just activate the right one using the mouse. Hitting Alt-Tab keys quickly will show you the next window in the queue, just like it used to.

If your X server already supports compositing, switching it on is as easy as opening System Settings, opening the Worskpace Appearance and Behaviour module, choosing Desktop Effects and enabling the checkbox Enable desktop effects at startup . More advanced compositing settings (such as Use VSync, Scale method, Compositing type) are available through the Advanced dialog. Customising the behaviour of the KWin effects means opening the All effects tab, and choosing the plugins you want to use. Please note that only a subset of the plugins works with XRender-based compositing. For the full experience, you need to use OpenGL mode.

Employing motion physics, KWin provides your windows with a more natural feel. New desktop effects like the Cube desktop switcher and Magic Lamp minimize animation have been added. Improvements in the existing effects make window management smoother than ever. KWin has seen many performance improvements to enable these effects even on low-end hardware. Elaborate checks have been build in to ensure users with low-end hardware are not presented with an unusable setup. KWin detects the capabilities of the hardware and if needed gracefully scales its effects down. You can take control and disable these checks or change settings like the global animation speed to fine-tune your experience. When your computer is under heavy load, KWin will automatically disable the compositing temporarily to keep things running smoothly. It will notify you if it does so, and you can re-enable compositing by pressing Shift+Alt+F12 . Finally, support for multiple screen handling has been improved in KWin using the new Kephal library. You can move maximized windows between Xinerama screens and the addition of external screens is handled correctly.

More information about what was introduced in KDE SC 4.9 can be found at the following link:

Tutorials

You want an application to launch in a specific size and position every time


Sometimes the screen position of an application is vital to your comfort, so use the flexibility of KWin to make sure it's always where you want it.

Position the window where you want it to open, then right-click on the title-bar, choosing Advanced -> Special Window Settings . This will open a settings window, with appropriate entries already made. All you need to do now is select the Size & Position tab and check Position and Size . OK - you are finished!

Customise the position of titlebar buttons

Take a look at System Settings -> Application Style -> Window Decorations -> Buttons tab. The options open to you may depend on your distribution or theme, and it's clear that there is more to come.


To simply move things around you work with the specimen titlebar. Drag icons there to where you want to see them.

You may find that you have other icons available to you. A circle indicates that the button will set that window on all desktops. Another icon that you may find useful is Shade - a toggle between rolled up (titlebar only visible) and normal view. These icons are added by dragging from the text description window onto the speciman title bar - just position them as you want to use them.

If you prefer a Classic, KDE3-style Desktop

Right-click on your desktop - select Desktop Settings (or Appearance Settings , in some distros). Change the Layout: from Desktop to Folder View . The whole desktop is now a folderview, and another right-click on the desktop will allow you to select FolderView Settings . Set the folderview to the directory you want to use as your desktop.

Читайте также: