KWin
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Properties | List of all members
KWin::Application Class Referenceabstract

#include <main.h>

Inheritance diagram for KWin::Application:
KWin::ApplicationWayland KWin::ApplicationX11 KWin::WaylandTestApplication KWin::X11TestApplication

Public Types

enum  OperationMode { OperationModeX11 , OperationModeWaylandOnly , OperationModeXwayland }
 This enum provides the various operation modes of KWin depending on the available Windowing Systems at startup. For example whether KWin only talks to X11 or also to a Wayland Compositor. More...
 
enum class  TimestampUpdate { OnlyIfLarger , Always }
 

Signals

void x11ConnectionChanged ()
 
void x11ConnectionAboutToBeDestroyed ()
 
void xwaylandScaleChanged ()
 
void workspaceCreated ()
 
void virtualTerminalCreated ()
 
void started ()
 

Public Member Functions

 ~Application () override
 
void setConfigLock (bool lock)
 
KSharedConfigPtr config () const
 
void setConfig (KSharedConfigPtr config)
 
KSharedConfigPtr kxkbConfig () const
 
void setKxkbConfig (KSharedConfigPtr config)
 
KSharedConfigPtr inputConfig () const
 
void setInputConfig (KSharedConfigPtr config)
 
void start ()
 
OperationMode operationMode () const
 The operation mode used by KWin.
 
void setOperationMode (OperationMode mode)
 
bool shouldUseWaylandForCompositing () const
 
void setupCommandLine (QCommandLineParser *parser)
 
void processCommandLine (QCommandLineParser *parser)
 
void registerEventFilter (X11EventFilter *filter)
 
void unregisterEventFilter (X11EventFilter *filter)
 
bool dispatchEvent (xcb_generic_event_t *event)
 
xcb_timestamp_t x11Time () const
 
void setX11Time (xcb_timestamp_t timestamp, TimestampUpdate force=TimestampUpdate::OnlyIfLarger)
 
void updateXTime ()
 
void updateX11Time (xcb_generic_event_t *event)
 
void resetCrashesCount ()
 
xcb_window_t x11RootWindow () const
 
xcb_window_t x11CompositeWindow () const
 
xcb_connection_t * x11Connection () const
 
void setX11RootWindow (xcb_window_t root)
 
void setX11Connection (xcb_connection_t *c)
 
void setX11CompositeWindow (xcb_window_t window)
 
qreal xwaylandScale () const
 
void setXwaylandScale (qreal scale)
 
QProcessEnvironment processStartupEnvironment () const
 
void setProcessStartupEnvironment (const QProcessEnvironment &environment)
 
OutputBackendoutputBackend () const
 
void setOutputBackend (std::unique_ptr< OutputBackend > &&backend)
 
Sessionsession () const
 
void setSession (std::unique_ptr< Session > &&session)
 
void setFollowLocale1 (bool follow)
 
bool followLocale1 () const
 
bool isTerminating () const
 
void installNativeX11EventFilter ()
 
void removeNativeX11EventFilter ()
 
void createAtoms ()
 
void destroyAtoms ()
 
virtual std::unique_ptr< EdgecreateScreenEdge (ScreenEdges *parent)
 
virtual std::unique_ptr< CursorcreatePlatformCursor ()
 
virtual std::unique_ptr< OutlineVisualcreateOutline (Outline *outline)
 
virtual void createEffectsHandler (Compositor *compositor, WorkspaceScene *scene)
 
PluginManagerpluginManager () const
 
InputMethodinputMethod () const
 
ColorManagercolorManager () const
 
virtual XwaylandInterfacexwayland () const
 
TabletModeManagertabletModeManager () const
 
virtual void startInteractiveWindowSelection (std::function< void(KWin::Window *)> callback, const QByteArray &cursorName=QByteArray())
 
virtual void startInteractivePositionSelection (std::function< void(const QPointF &)> callback)
 
virtual PlatformCursorImage cursorImage () const
 

Static Public Member Functions

static void setCrashCount (int count)
 
static bool wasCrash ()
 
static void createAboutData ()
 
static void setupMalloc ()
 
static void setupLocalizedString ()
 

Protected Member Functions

 Application (OperationMode mode, int &argc, char **argv)
 
virtual void performStartup ()=0
 
void notifyKSplash ()
 
void notifyStarted ()
 
void createInput ()
 
void createWorkspace ()
 
void createOptions ()
 
void createPlugins ()
 
void createColorManager ()
 
void createInputMethod ()
 
void createTabletModeManager ()
 
void destroyInput ()
 
void destroyWorkspace ()
 
void destroyCompositor ()
 
void destroyPlugins ()
 
void destroyColorManager ()
 
void destroyInputMethod ()
 
void destroyPlatform ()
 
void applyXwaylandScale ()
 
void setTerminating ()
 

Static Protected Attributes

static int crashes = 0
 

Properties

quint32 x11Time
 
quint32 x11RootWindow
 
void * x11Connection
 
KSharedConfigPtr config
 
KSharedConfigPtr kxkbConfig
 

Detailed Description

Definition at line 68 of file main.h.

Member Enumeration Documentation

◆ OperationMode

This enum provides the various operation modes of KWin depending on the available Windowing Systems at startup. For example whether KWin only talks to X11 or also to a Wayland Compositor.

Enumerator
OperationModeX11 

KWin uses only X11 for managing windows and compositing.

OperationModeWaylandOnly 

KWin uses only Wayland.

OperationModeXwayland 

KWin uses Wayland and controls a nested Xwayland server.

Definition at line 83 of file main.h.

◆ TimestampUpdate

Enumerator
OnlyIfLarger 
Always 

Definition at line 150 of file main.h.

Constructor & Destructor Documentation

◆ ~Application()

KWin::Application::~Application ( )
override

Definition at line 138 of file main.cpp.

◆ Application()

KWin::Application::Application ( Application::OperationMode mode,
int & argc,
char ** argv )
protected

Definition at line 77 of file main.cpp.

Member Function Documentation

◆ applyXwaylandScale()

void KWin::Application::applyXwaylandScale ( )
protected

Definition at line 392 of file main.cpp.

◆ colorManager()

ColorManager * KWin::Application::colorManager ( ) const

Definition at line 660 of file main.cpp.

◆ config()

KSharedConfigPtr KWin::Application::config ( ) const
inline

Definition at line 102 of file main.h.

◆ createAboutData()

void KWin::Application::createAboutData ( )
static

Creates the KAboutData object for the KWin instance and registers it as KAboutData::setApplicationData.

Definition at line 177 of file main.cpp.

◆ createAtoms()

void KWin::Application::createAtoms ( )

Definition at line 263 of file main.cpp.

◆ createColorManager()

void KWin::Application::createColorManager ( )
protected

Definition at line 278 of file main.cpp.

◆ createEffectsHandler()

void KWin::Application::createEffectsHandler ( Compositor * compositor,
WorkspaceScene * scene )
virtual

Reimplemented in KWin::ApplicationX11.

Definition at line 356 of file main.cpp.

◆ createInput()

void KWin::Application::createInput ( )
protected

Definition at line 253 of file main.cpp.

◆ createInputMethod()

void KWin::Application::createInputMethod ( )
protected

Definition at line 283 of file main.cpp.

◆ createOptions()

void KWin::Application::createOptions ( )
protected

Definition at line 268 of file main.cpp.

◆ createOutline()

std::unique_ptr< OutlineVisual > KWin::Application::createOutline ( Outline * outline)
virtual

Reimplemented in KWin::ApplicationX11.

Definition at line 348 of file main.cpp.

◆ createPlatformCursor()

std::unique_ptr< Cursor > KWin::Application::createPlatformCursor ( )
virtual

Reimplemented in KWin::ApplicationX11.

Definition at line 343 of file main.cpp.

◆ createPlugins()

void KWin::Application::createPlugins ( )
protected

Definition at line 273 of file main.cpp.

◆ createScreenEdge()

std::unique_ptr< Edge > KWin::Application::createScreenEdge ( ScreenEdges * parent)
virtual

Reimplemented in KWin::ApplicationX11.

Definition at line 338 of file main.cpp.

◆ createTabletModeManager()

void KWin::Application::createTabletModeManager ( )
protected

Definition at line 288 of file main.cpp.

◆ createWorkspace()

void KWin::Application::createWorkspace ( )
protected

Definition at line 239 of file main.cpp.

◆ cursorImage()

PlatformCursorImage KWin::Application::cursorImage ( ) const
virtual

Returns a PlatformCursorImage. By default this is created by softwareCursor and softwareCursorHotspot. An implementing subclass can use this to provide a better suited PlatformCursorImage.

See also
softwareCursor
softwareCursorHotspot
Since
5.9

Reimplemented in KWin::ApplicationX11.

Definition at line 728 of file main.cpp.

◆ destroyAtoms()

void KWin::Application::destroyAtoms ( )

Definition at line 151 of file main.cpp.

◆ destroyColorManager()

void KWin::Application::destroyColorManager ( )
protected

Definition at line 328 of file main.cpp.

◆ destroyCompositor()

void KWin::Application::destroyCompositor ( )
protected

Definition at line 318 of file main.cpp.

◆ destroyInput()

void KWin::Application::destroyInput ( )
protected

Definition at line 308 of file main.cpp.

◆ destroyInputMethod()

void KWin::Application::destroyInputMethod ( )
protected

Definition at line 333 of file main.cpp.

◆ destroyPlatform()

void KWin::Application::destroyPlatform ( )
protected

Definition at line 157 of file main.cpp.

◆ destroyPlugins()

void KWin::Application::destroyPlugins ( )
protected

Definition at line 323 of file main.cpp.

◆ destroyWorkspace()

void KWin::Application::destroyWorkspace ( )
protected

Definition at line 313 of file main.cpp.

◆ dispatchEvent()

bool KWin::Application::dispatchEvent ( xcb_generic_event_t * event)

Definition at line 423 of file main.cpp.

◆ followLocale1()

bool KWin::Application::followLocale1 ( ) const
inline

Definition at line 257 of file main.h.

◆ inputConfig()

KSharedConfigPtr KWin::Application::inputConfig ( ) const
inline

Definition at line 120 of file main.h.

◆ inputMethod()

InputMethod * KWin::Application::inputMethod ( ) const

Definition at line 655 of file main.cpp.

◆ installNativeX11EventFilter()

void KWin::Application::installNativeX11EventFilter ( )

Definition at line 298 of file main.cpp.

◆ isTerminating()

bool KWin::Application::isTerminating ( ) const
inline

Definition at line 262 of file main.h.

◆ kxkbConfig()

KSharedConfigPtr KWin::Application::kxkbConfig ( ) const
inline

Definition at line 111 of file main.h.

◆ notifyKSplash()

void KWin::Application::notifyKSplash ( )
protected

◆ notifyStarted()

void KWin::Application::notifyStarted ( )
protected

Definition at line 146 of file main.cpp.

◆ operationMode()

Application::OperationMode KWin::Application::operationMode ( ) const

The operation mode used by KWin.

Returns
OperationMode

Definition at line 97 of file main.cpp.

◆ outputBackend()

OutputBackend * KWin::Application::outputBackend ( ) const
inline

Definition at line 242 of file main.h.

◆ performStartup()

virtual void KWin::Application::performStartup ( )
protectedpure virtual

◆ pluginManager()

PluginManager * KWin::Application::pluginManager ( ) const

Definition at line 650 of file main.cpp.

◆ processCommandLine()

void KWin::Application::processCommandLine ( QCommandLineParser * parser)

Definition at line 212 of file main.cpp.

◆ processStartupEnvironment()

QProcessEnvironment KWin::Application::processStartupEnvironment ( ) const

Definition at line 628 of file main.cpp.

◆ registerEventFilter()

void KWin::Application::registerEventFilter ( X11EventFilter * filter)

Definition at line 361 of file main.cpp.

◆ removeNativeX11EventFilter()

void KWin::Application::removeNativeX11EventFilter ( )

Definition at line 303 of file main.cpp.

◆ resetCrashesCount()

void KWin::Application::resetCrashesCount ( )

Definition at line 162 of file main.cpp.

◆ session()

Session * KWin::Application::session ( ) const
inline

Definition at line 248 of file main.h.

◆ setConfig()

void KWin::Application::setConfig ( KSharedConfigPtr config)
inline

Definition at line 106 of file main.h.

◆ setConfigLock()

void KWin::Application::setConfigLock ( bool lock)

Definition at line 92 of file main.cpp.

◆ setCrashCount()

void KWin::Application::setCrashCount ( int count)
static

Definition at line 167 of file main.cpp.

◆ setFollowLocale1()

void KWin::Application::setFollowLocale1 ( bool follow)
inline

Definition at line 253 of file main.h.

◆ setInputConfig()

void KWin::Application::setInputConfig ( KSharedConfigPtr config)
inline

Definition at line 124 of file main.h.

◆ setKxkbConfig()

void KWin::Application::setKxkbConfig ( KSharedConfigPtr config)
inline

Definition at line 115 of file main.h.

◆ setOperationMode()

void KWin::Application::setOperationMode ( OperationMode mode)

Definition at line 102 of file main.cpp.

◆ setOutputBackend()

void KWin::Application::setOutputBackend ( std::unique_ptr< OutputBackend > && backend)

Definition at line 638 of file main.cpp.

◆ setProcessStartupEnvironment()

void KWin::Application::setProcessStartupEnvironment ( const QProcessEnvironment & environment)

Definition at line 633 of file main.cpp.

◆ setSession()

void KWin::Application::setSession ( std::unique_ptr< Session > && session)

Definition at line 644 of file main.cpp.

◆ setTerminating()

void KWin::Application::setTerminating ( )
inlineprotected

Definition at line 365 of file main.h.

◆ setupCommandLine()

void KWin::Application::setupCommandLine ( QCommandLineParser * parser)

Definition at line 201 of file main.cpp.

◆ setupLocalizedString()

void KWin::Application::setupLocalizedString ( )
static

Definition at line 234 of file main.cpp.

◆ setupMalloc()

void KWin::Application::setupMalloc ( )
static

Definition at line 220 of file main.cpp.

◆ setX11CompositeWindow()

void KWin::Application::setX11CompositeWindow ( xcb_window_t window)
inline

Definition at line 216 of file main.h.

◆ setX11Connection()

void KWin::Application::setX11Connection ( xcb_connection_t * c)
inline

Inheriting classes should use this method to set the xcb connection before accessing any X11 specific code pathes.

Definition at line 212 of file main.h.

◆ setX11RootWindow()

void KWin::Application::setX11RootWindow ( xcb_window_t root)
inline

Inheriting classes should use this method to set the X11 root window before accessing any X11 specific code pathes.

Definition at line 204 of file main.h.

◆ setX11Time()

void KWin::Application::setX11Time ( xcb_timestamp_t timestamp,
TimestampUpdate force = TimestampUpdate::OnlyIfLarger )
inline

Definition at line 154 of file main.h.

◆ setXwaylandScale()

void KWin::Application::setXwaylandScale ( qreal scale)

Definition at line 382 of file main.cpp.

◆ shouldUseWaylandForCompositing()

bool KWin::Application::shouldUseWaylandForCompositing ( ) const

Definition at line 107 of file main.cpp.

◆ start()

void KWin::Application::start ( )

Definition at line 112 of file main.cpp.

◆ started

void KWin::Application::started ( )
signal

◆ startInteractivePositionSelection()

void KWin::Application::startInteractivePositionSelection ( std::function< void(const QPointF &)> callback)
virtual

Starts an interactive position selection process.

Once the user selected a position on the screen the callback is invoked with the selected point as argument. In case the user cancels the interactive position selection or selecting a position is currently not possible (e.g. screen locked) the callback is invoked with a point at -1 as x and y argument.

During the interactive window selection the cursor is turned into a crosshair cursor.

The default implementation forwards to InputRedirection.

Parameters
callbackThe function to invoke once the interactive position selection ends

Reimplemented in KWin::ApplicationX11.

Definition at line 759 of file main.cpp.

◆ startInteractiveWindowSelection()

void KWin::Application::startInteractiveWindowSelection ( std::function< void(KWin::Window *)> callback,
const QByteArray & cursorName = QByteArray() )
virtual

Starts an interactive window selection process.

Once the user selected a window the callback is invoked with the selected Window as argument. In case the user cancels the interactive window selection or selecting a window is currently not possible (e.g. screen locked) the callback is invoked with a nullptr argument.

During the interactive window selection the cursor is turned into a crosshair cursor unless cursorName is provided. The argument cursorName is a QByteArray instead of Qt::CursorShape to support the "pirate" cursor for kill window which is not wrapped by Qt::CursorShape.

The default implementation forwards to InputRedirection.

Parameters
callbackThe function to invoke once the interactive window selection ends
cursorNameThe optional name of the cursor shape to use, default is crosshair

Reimplemented in KWin::ApplicationX11.

Definition at line 750 of file main.cpp.

◆ tabletModeManager()

TabletModeManager * KWin::Application::tabletModeManager ( ) const

Definition at line 293 of file main.cpp.

◆ unregisterEventFilter()

void KWin::Application::unregisterEventFilter ( X11EventFilter * filter)

Definition at line 412 of file main.cpp.

◆ updateX11Time()

void KWin::Application::updateX11Time ( xcb_generic_event_t * event)

Definition at line 546 of file main.cpp.

◆ updateXTime()

void KWin::Application::updateXTime ( )

Queries the current X11 time stamp of the X server.

Definition at line 529 of file main.cpp.

◆ virtualTerminalCreated

void KWin::Application::virtualTerminalCreated ( )
signal

◆ wasCrash()

bool KWin::Application::wasCrash ( )
static

Definition at line 172 of file main.cpp.

◆ workspaceCreated

void KWin::Application::workspaceCreated ( )
signal

◆ x11CompositeWindow()

xcb_window_t KWin::Application::x11CompositeWindow ( ) const
inline
Returns
the X11 composite overlay window handle.

Definition at line 187 of file main.h.

◆ x11Connection()

xcb_connection_t * KWin::Application::x11Connection ( ) const
inline
Returns
the X11 xcb connection

Definition at line 195 of file main.h.

◆ x11ConnectionAboutToBeDestroyed

void KWin::Application::x11ConnectionAboutToBeDestroyed ( )
signal

◆ x11ConnectionChanged

void KWin::Application::x11ConnectionChanged ( )
signal

◆ x11RootWindow()

xcb_window_t KWin::Application::x11RootWindow ( ) const
inline
Returns
the X11 root window.

Definition at line 179 of file main.h.

◆ x11Time()

xcb_timestamp_t KWin::Application::x11Time ( ) const
inline

Definition at line 146 of file main.h.

◆ xwayland()

XwaylandInterface * KWin::Application::xwayland ( ) const
virtual

Reimplemented in KWin::WaylandTestApplication, and KWin::ApplicationWayland.

Definition at line 665 of file main.cpp.

◆ xwaylandScale()

qreal KWin::Application::xwaylandScale ( ) const
inline

Definition at line 221 of file main.h.

◆ xwaylandScaleChanged

void KWin::Application::xwaylandScaleChanged ( )
signal

Member Data Documentation

◆ crashes

int KWin::Application::crashes = 0
staticprotected

Definition at line 371 of file main.h.

Property Documentation

◆ config

KSharedConfigPtr KWin::Application::config
readwrite

Definition at line 74 of file main.h.

◆ kxkbConfig

KSharedConfigPtr KWin::Application::kxkbConfig
readwrite

Definition at line 75 of file main.h.

◆ x11Connection

void * KWin::Application::x11Connection
read

Definition at line 73 of file main.h.

◆ x11RootWindow

quint32 KWin::Application::x11RootWindow
read

Definition at line 72 of file main.h.

◆ x11Time

quint32 KWin::Application::x11Time
readwrite

Definition at line 71 of file main.h.


The documentation for this class was generated from the following files: