• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-workspace API Reference
  • KDE Home
  • Contact Us
 

KWin

  • kde-4.x
  • kde-workspace
  • kwin
main.cpp
Go to the documentation of this file.
1 /********************************************************************
2  KWin - the KDE window manager
3  This file is part of the KDE project.
4 
5 Copyright (C) 1999, 2000 Matthias Ettrich <[email protected]>
6 Copyright (C) 2003 Lubos Lunak <[email protected]>
7 
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *********************************************************************/
21 
22 #include "main.h"
23 #include <config-kwin.h>
24 // kwin
25 #include "atoms.h"
26 #include "options.h"
27 #include "sm.h"
28 #include "workspace.h"
29 #include "xcbutils.h"
30 
31 // KDE
32 #include <KAboutData>
33 #include <KConfig>
34 #include <KConfigGroup>
35 #include <KCrash>
36 #include <KLocalizedString>
37 #include <KSharedConfig>
38 // Qt
39 #include <qplatformdefs.h>
40 #include <QDebug>
41 #include <QComboBox>
42 #include <qcommandlineparser.h>
43 #include <QDialog>
44 #include <QDialogButtonBox>
45 #include <QLabel>
46 #include <QPushButton>
47 #include <QQuickWindow>
48 #include <QStandardPaths>
49 #include <QVBoxLayout>
50 #include <QtDBus/QtDBus>
51 #include <QX11Info>
52 // TODO: remove once QX11Info provides the X screen
53 #include <X11/Xlib.h>
54 
55 // system
56 #ifdef HAVE_UNISTD_H
57 #include <unistd.h>
58 #endif // HAVE_UNISTD_H
59 
60 #ifdef HAVE_MALLOC_H
61 #include <malloc.h>
62 #endif // HAVE_MALLOC_H
63 
64 namespace KWin
65 {
66 
67 Options* options;
68 
69 Atoms* atoms;
70 
71 int screen_number = -1;
72 bool is_multihead = false;
73 
74 //************************************
75 // KWinSelectionOwner
76 //************************************
77 
78 KWinSelectionOwner::KWinSelectionOwner(int screen_P)
79  : KSelectionOwner(make_selection_atom(screen_P), screen_P)
80 {
81 }
82 
83 xcb_atom_t KWinSelectionOwner::make_selection_atom(int screen_P)
84 {
85  if (screen_P < 0)
86  screen_P = DefaultScreen(display());
87  QByteArray screen(QByteArrayLiteral("WM_S"));
88  screen.append(QByteArray::number(screen_P));
89  ScopedCPointer<xcb_intern_atom_reply_t> atom(xcb_intern_atom_reply(
90  connection(),
91  xcb_intern_atom_unchecked(connection(), false, screen.length(), screen.constData()),
92  nullptr));
93  if (atom.isNull()) {
94  return XCB_ATOM_NONE;
95  }
96  return atom->atom;
97 }
98 
99 void KWinSelectionOwner::getAtoms()
100 {
101  KSelectionOwner::getAtoms();
102  if (xa_version == XCB_ATOM_NONE) {
103  const QByteArray name(QByteArrayLiteral("VERSION"));
104  ScopedCPointer<xcb_intern_atom_reply_t> atom(xcb_intern_atom_reply(
105  connection(),
106  xcb_intern_atom_unchecked(connection(), false, name.length(), name.constData()),
107  nullptr));
108  if (!atom.isNull()) {
109  xa_version = atom->atom;
110  }
111  }
112 }
113 
114 void KWinSelectionOwner::replyTargets(xcb_atom_t property_P, xcb_window_t requestor_P)
115 {
116  KSelectionOwner::replyTargets(property_P, requestor_P);
117  xcb_atom_t atoms[ 1 ] = { xa_version };
118  // PropModeAppend !
119  xcb_change_property(connection(), XCB_PROP_MODE_APPEND, requestor_P,
120  property_P, XCB_ATOM_ATOM, 32, 1, atoms);
121 }
122 
123 bool KWinSelectionOwner::genericReply(xcb_atom_t target_P, xcb_atom_t property_P, xcb_window_t requestor_P)
124 {
125  if (target_P == xa_version) {
126  int32_t version[] = { 2, 0 };
127  xcb_change_property(connection(), XCB_PROP_MODE_REPLACE, requestor_P,
128  property_P, XCB_ATOM_INTEGER, 32, 2, version);
129  } else
130  return KSelectionOwner::genericReply(target_P, property_P, requestor_P);
131  return true;
132 }
133 
134 xcb_atom_t KWinSelectionOwner::xa_version = XCB_ATOM_NONE;
135 
136 class AlternativeWMDialog : public QDialog
137 {
138 public:
139  AlternativeWMDialog()
140  : QDialog() {
141  QWidget* mainWidget = new QWidget(this);
142  QVBoxLayout* layout = new QVBoxLayout(mainWidget);
143  QString text = i18n(
144  "KWin is unstable.\n"
145  "It seems to have crashed several times in a row.\n"
146  "You can select another window manager to run:");
147  QLabel* textLabel = new QLabel(text, mainWidget);
148  layout->addWidget(textLabel);
149  wmList = new QComboBox(mainWidget);
150  wmList->setEditable(true);
151  layout->addWidget(wmList);
152 
153  addWM(QStringLiteral("metacity"));
154  addWM(QStringLiteral("openbox"));
155  addWM(QStringLiteral("fvwm2"));
156  addWM(QStringLiteral(KWIN_NAME));
157 
158  QVBoxLayout *mainLayout = new QVBoxLayout(this);
159  mainLayout->addWidget(mainWidget);
160  QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
161  buttons->button(QDialogButtonBox::Ok)->setDefault(true);
162  connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
163  connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
164  mainLayout->addWidget(buttons);
165 
166  raise();
167  }
168 
169  void addWM(const QString& wm) {
170  // TODO: Check if WM is installed
171  if (!QStandardPaths::findExecutable(wm).isEmpty())
172  wmList->addItem(wm);
173  }
174  QString selectedWM() const {
175  return wmList->currentText();
176  }
177 
178 private:
179  QComboBox* wmList;
180 };
181 
182 int Application::crashes = 0;
183 
184 Application::Application(int &argc, char **argv)
185  : QApplication(argc, argv)
186  , owner()
187  , m_eventFilter(new XcbEventFilter())
188  , m_replace(false)
189  , m_configLock(false)
190  , m_operationMode(OperationModeX11)
191 {
192 }
193 
194 void Application::setConfigLock(bool lock)
195 {
196  m_configLock = lock;
197 }
198 
199 void Application::setReplace(bool replace)
200 {
201  m_replace = replace;
202 }
203 
204 Application::OperationMode Application::operationMode() const
205 {
206  return m_operationMode;
207 }
208 
209 void Application::setOperationMode(OperationMode mode)
210 {
211  m_operationMode = mode;
212 }
213 
214 bool Application::shouldUseWaylandForCompositing() const
215 {
216  return m_operationMode == OperationModeWaylandAndX11;
217 }
218 
219 bool Application::requiresCompositing() const
220 {
221  return shouldUseWaylandForCompositing();
222 }
223 
224 void Application::start()
225 {
226  setQuitOnLastWindowClosed(false);
227 
228  KSharedConfig::Ptr config = KSharedConfig::openConfig();
229  if (!config->isImmutable() && m_configLock) {
230  // TODO: This shouldn't be necessary
231  //config->setReadOnly( true );
232  config->reparseConfiguration();
233  }
234 
235  if (screen_number == -1)
236  screen_number = QX11Info::appScreen();
237 
238  owner.reset(new KWinSelectionOwner(screen_number));
239  connect(owner.data(), &KSelectionOwner::failedToClaimOwnership, []{
240  fputs(i18n("kwin: unable to claim manager selection, another wm running? (try using --replace)\n").toLocal8Bit().constData(), stderr);
241  ::exit(1);
242  });
243  connect(owner.data(), SIGNAL(lostOwnership()), SLOT(lostSelection()));
244  connect(owner.data(), &KSelectionOwner::claimedOwnership, [this]{
245  // we want all QQuickWindows with an alpha buffer
246  QQuickWindow::setDefaultAlphaBuffer(true);
247 
248  installNativeEventFilter(m_eventFilter.data());
249  // first load options - done internally by a different thread
250  options = new Options;
251 
252  // Check whether another windowmanager is running
253  const uint32_t maskValues[] = {XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT};
254  ScopedCPointer<xcb_generic_error_t> redirectCheck(xcb_request_check(connection(),
255  xcb_change_window_attributes_checked(connection(),
256  rootWindow(),
257  XCB_CW_EVENT_MASK,
258  maskValues)));
259  if (!redirectCheck.isNull()) {
260  fputs(i18n("kwin: another window manager is running (try using --replace)\n").toLocal8Bit().constData(), stderr);
261  ::exit(1);
262  }
263 
264  atoms->retrieveHelpers();
265 
266  // This tries to detect compositing options and can use GLX. GLX problems
267  // (X errors) shouldn't cause kwin to abort, so this is out of the
268  // critical startup section where x errors cause kwin to abort.
269 
270  // create workspace.
271  (void) new Workspace(isSessionRestored());
272 
273  Xcb::sync(); // Trigger possible errors, there's still a chance to abort
274 
275  // Tell KSplash that KWin has started
276  QDBusMessage ksplashProgressMessage = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KSplash"),
277  QStringLiteral("/KSplash"),
278  QStringLiteral("org.kde.KSplash"),
279  QStringLiteral("setStage"));
280  ksplashProgressMessage.setArguments(QList<QVariant>() << QStringLiteral("wm"));
281  QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage);
282  });
283  crashChecking();
284  // we need to do an XSync here, otherwise the QPA might crash us later on
285  Xcb::sync();
286  owner->claim(m_replace, true);
287 
288  atoms = new Atoms;
289 }
290 
291 Application::~Application()
292 {
293  delete Workspace::self();
294  if (!owner.isNull() && owner->ownerWindow() != XCB_WINDOW_NONE) // If there was no --replace (no new WM)
295  Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT);
296  delete options;
297  delete atoms;
298 }
299 
300 void Application::crashChecking()
301 {
302  KCrash::setEmergencySaveFunction(Application::crashHandler);
303  if (crashes >= 4) {
304  // Something has gone seriously wrong
305  AlternativeWMDialog dialog;
306  QString cmd = QStringLiteral(KWIN_NAME);
307  if (dialog.exec() == QDialog::Accepted)
308  cmd = dialog.selectedWM();
309  else
310  ::exit(1);
311  if (cmd.length() > 500) {
312  qDebug() << "Command is too long, truncating";
313  cmd = cmd.left(500);
314  }
315  qDebug() << "Starting" << cmd << "and exiting";
316  char buf[1024];
317  sprintf(buf, "%s &", cmd.toAscii().data());
318  system(buf);
319  ::exit(1);
320  }
321  if (crashes >= 2) {
322  // Disable compositing if we have had too many crashes
323  qDebug() << "Too many crashes recently, disabling compositing";
324  KConfigGroup compgroup(KSharedConfig::openConfig(), "Compositing");
325  compgroup.writeEntry("Enabled", false);
326  }
327  // Reset crashes count if we stay up for more that 15 seconds
328  QTimer::singleShot(15 * 1000, this, SLOT(resetCrashesCount()));
329 }
330 
331 void Application::lostSelection()
332 {
333  sendPostedEvents();
334  delete Workspace::self();
335  // Remove windowmanager privileges
336  Xcb::selectInput(rootWindow(), XCB_EVENT_MASK_PROPERTY_CHANGE);
337  quit();
338 }
339 
340 bool Application::notify(QObject* o, QEvent* e)
341 {
342  if (Workspace::self()->workspaceEvent(e))
343  return true;
344  return QApplication::notify(o, e);
345 }
346 
347 static void sighandler(int)
348 {
349  QApplication::exit();
350 }
351 
352 void Application::crashHandler(int signal)
353 {
354  crashes++;
355 
356  fprintf(stderr, "Application::crashHandler() called with signal %d; recent crashes: %d\n", signal, crashes);
357  char cmd[1024];
358  sprintf(cmd, "%s --crashes %d &",
359  QFile::encodeName(QCoreApplication::applicationFilePath()).constData(), crashes);
360 
361  sleep(1);
362  system(cmd);
363 }
364 
365 void Application::resetCrashesCount()
366 {
367  crashes = 0;
368 }
369 
370 void Application::setCrashCount(int count)
371 {
372  crashes = count;
373 }
374 
375 bool Application::wasCrash()
376 {
377  return crashes > 0;
378 }
379 
380 bool XcbEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long int *result)
381 {
382  Q_UNUSED(result)
383  if (!Workspace::self()) {
384  // Workspace not yet created
385  return false;
386  }
387  if (eventType != "xcb_generic_event_t") {
388  return false;
389  }
390  return Workspace::self()->workspaceEvent(static_cast<xcb_generic_event_t *>(message));
391 }
392 
393 } // namespace
394 
395 static const char version[] = KWIN_VERSION_STRING;
396 static const char description[] = I18N_NOOP("KDE window manager");
397 
398 extern "C"
399 KWIN_EXPORT int kdemain(int argc, char * argv[])
400 {
401 #ifdef M_TRIM_THRESHOLD
402  // Prevent fragmentation of the heap by malloc (glibc).
403  //
404  // The default threshold is 128*1024, which can result in a large memory usage
405  // due to fragmentation especially if we use the raster graphicssystem. On the
406  // otherside if the threshold is too low, free() starts to permanently ask the kernel
407  // about shrinking the heap.
408 #ifdef HAVE_UNISTD_H
409  const int pagesize = sysconf(_SC_PAGESIZE);
410 #else
411  const int pagesize = 4*1024;
412 #endif // HAVE_UNISTD_H
413  mallopt(M_TRIM_THRESHOLD, 5*pagesize);
414 #endif // M_TRIM_THRESHOLD
415 
416  QLoggingCategory::setFilterRules(QStringLiteral("aurorae.debug = true\n") +
417  QStringLiteral("kwineffects.debug = true"));
418 
419  int primaryScreen = 0;
420  xcb_connection_t *c = xcb_connect(nullptr, &primaryScreen);
421  if (!c || xcb_connection_has_error(c)) {
422  fprintf(stderr, "%s: FATAL ERROR while trying to open display %s\n",
423  argv[0], qgetenv("DISPLAY").constData());
424  exit(1);
425  }
426 
427  const int number_of_screens = xcb_setup_roots_length(xcb_get_setup(c));
428 
429  // multi head
430  auto isMultiHead = []() -> bool {
431  QByteArray multiHead = qgetenv("KDE_MULTIHEAD");
432  if (!multiHead.isEmpty()) {
433  return (multiHead.toLower() == "true");
434  }
435  return true;
436  };
437  if (number_of_screens != 1 && isMultiHead()) {
438  KWin::is_multihead = true;
439  KWin::screen_number = primaryScreen;
440  int pos; // Temporarily needed to reconstruct DISPLAY var if multi-head
441  QByteArray display_name = qgetenv("DISPLAY");
442  xcb_disconnect(c);
443  c = nullptr;
444 
445  if ((pos = display_name.lastIndexOf('.')) != -1)
446  display_name.remove(pos, 10); // 10 is enough to be sure we removed ".s"
447 
448  QString envir;
449  for (int i = 0; i < number_of_screens; i++) {
450  // If execution doesn't pass by here, then kwin
451  // acts exactly as previously
452  if (i != KWin::screen_number && fork() == 0) {
453  KWin::screen_number = i;
454  // Break here because we are the child process, we don't
455  // want to fork() anymore
456  break;
457  }
458  }
459  // In the next statement, display_name shouldn't contain a screen
460  // number. If it had it, it was removed at the "pos" check
461  envir.sprintf("DISPLAY=%s.%d", display_name.data(), KWin::screen_number);
462 
463  if (putenv(strdup(envir.toAscii().constData()))) {
464  fprintf(stderr, "%s: WARNING: unable to set DISPLAY environment variable\n", argv[0]);
465  perror("putenv()");
466  }
467  }
468 
469  if (signal(SIGTERM, KWin::sighandler) == SIG_IGN)
470  signal(SIGTERM, SIG_IGN);
471  if (signal(SIGINT, KWin::sighandler) == SIG_IGN)
472  signal(SIGINT, SIG_IGN);
473  if (signal(SIGHUP, KWin::sighandler) == SIG_IGN)
474  signal(SIGHUP, SIG_IGN);
475 
476  // Disable the glib event loop integration, since it seems to be responsible
477  // for several bug reports about high CPU usage (bug #239963)
478  setenv("QT_NO_GLIB", "1", true);
479 
480  // enforce xcb plugin, unfortunately command line switch has precedence
481  setenv("QT_QPA_PLATFORM", "xcb", true);
482 
483  KWin::Application a(argc, argv);
484 
485  a.setApplicationName(QStringLiteral(KWIN_NAME));
486  a.setApplicationVersion(QStringLiteral(KWIN_VERSION_STRING));
487  a.setApplicationDisplayName(i18n("KWin"));
488 
489  KAboutData aboutData(QStringLiteral(KWIN_NAME), // The program name used internally
490  QString(), // The message catalog name. If null, program name is used instead
491  i18n("KWin"), // A displayable program name string
492  QStringLiteral(KWIN_VERSION_STRING), // The program version string
493  i18n(description), // Short description of what the app does
494  KAboutData::License_GPL, // The license this code is released under
495  i18n("(c) 1999-2013, The KDE Developers")); // Copyright Statement
496 
497  aboutData.addAuthor(i18n("Matthias Ettrich"), QString(), QStringLiteral("[email protected]"));
498  aboutData.addAuthor(i18n("Cristian Tibirna"), QString(), QStringLiteral("[email protected]"));
499  aboutData.addAuthor(i18n("Daniel M. Duley"), QString(), QStringLiteral("[email protected]"));
500  aboutData.addAuthor(i18n("Luboš Luňák"), QString(), QStringLiteral("[email protected]"));
501  aboutData.addAuthor(i18n("Martin Gräßlin"), i18n("Maintainer"), QStringLiteral("[email protected]"));
502 
503  QCommandLineOption lockOption(QStringLiteral("lock"), i18n("Disable configuration options"));
504  QCommandLineOption replaceOption(QStringLiteral("replace"), i18n("Replace already-running ICCCM2.0-compliant window manager"));
505  QCommandLineOption crashesOption(QStringLiteral("crashes"), i18n("Indicate that KWin has recently crashed n times"), QStringLiteral("n"));
506 
507  QCommandLineParser parser;
508  parser.setApplicationDescription(i18n("KDE window manager"));
509  parser.addVersionOption();
510  parser.addHelpOption();
511  parser.addOption(lockOption);
512  parser.addOption(replaceOption);
513  parser.addOption(crashesOption);
514 
515  parser.process(a);
516 
517  KWin::Application::setCrashCount(parser.value(crashesOption).toInt());
518  a.setConfigLock(parser.isSet(lockOption));
519  a.setReplace(parser.isSet(replaceOption));
520 
521  // perform sanity checks
522  if (a.platformName().toLower() != QStringLiteral("xcb")) {
523  fprintf(stderr, "%s: FATAL ERROR expecting platform xcb but got platform %s\n",
524  argv[0], qPrintable(a.platformName()));
525  exit(1);
526  }
527  if (!KWin::display()) {
528  fprintf(stderr, "%s: FATAL ERROR KWin requires Xlib support in the xcb plugin. Do not configure Qt with -no-xcb-xlib\n",
529  argv[0]);
530  exit(1);
531  }
532 
533  a.start();
534 
535 #warning SessionManager needs porting
536 #if KWIN_QT5_PORTING
537  KWin::SessionManager weAreIndeed;
538 #endif
539  KWin::SessionSaveDoneHelper helper;
540 #warning insertCatalog needs porting
541 #if KWIN_QT5_PORTING
542  KGlobal::locale()->insertCatalog("kwin_effects");
543  KGlobal::locale()->insertCatalog("kwin_scripts");
544  KGlobal::locale()->insertCatalog("kwin_scripting");
545 #endif
546 
547  QString appname;
548  if (KWin::screen_number == 0)
549  appname = QStringLiteral("org.kde.kwin");
550  else
551  appname.sprintf("org.kde.kwin-screen-%d", KWin::screen_number);
552 
553  QDBusConnection::sessionBus().interface()->registerService(
554  appname, QDBusConnectionInterface::DontQueueService);
555 
556  return a.exec();
557 }
558 
559 #include "main.moc"
KWin::Application::OperationMode
OperationMode
This enum provides the various operation modes of KWin depending on the available Windowing Systems a...
Definition: main.h:65
xcbutils.h
KWin::Application::operationMode
OperationMode operationMode() const
The operation mode used by KWin.
Definition: main.cpp:204
QEvent
QWidget
atoms.h
sm.h
KWin::Application::setCrashCount
static void setCrashCount(int count)
Definition: main.cpp:370
QDialog::reject
virtual void reject()
QApplication::setQuitOnLastWindowClosed
void setQuitOnLastWindowClosed(bool quit)
QDialogButtonBox::rejected
void rejected()
QByteArray::toLower
QByteArray toLower() const
QByteArray
KSelectionOwner
KWin::Atoms
Definition: atoms.h:31
QByteArray::lastIndexOf
int lastIndexOf(char ch, int from) const
KWin::Application::OperationModeWaylandAndX11
KWin uses X11 for managing windows, but renders to a Wayland compositor.
Definition: main.h:74
KWin::options
Options * options
Definition: main.cpp:67
QDBusConnection::interface
QDBusConnectionInterface * interface() const
QApplication
KWin::XcbEventFilter::nativeEventFilter
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override
Definition: main.cpp:380
QByteArray::isEmpty
bool isEmpty() const
KWin::Workspace
Definition: workspace.h:60
KWin::screen_number
int screen_number
Definition: compositingprefs.cpp:39
QDBusConnection::sessionBus
QDBusConnection sessionBus()
QByteArray::length
int length() const
KWin::XcbEventFilter
Definition: main.h:34
KWin::Application::shouldUseWaylandForCompositing
bool shouldUseWaylandForCompositing() const
Definition: main.cpp:214
kdemain
KWIN_EXPORT int kdemain(int argc, char *argv[])
Definition: main.cpp:399
KWin::KWinSelectionOwner::getAtoms
virtual void getAtoms()
Definition: main.cpp:99
QCoreApplication::lock
void lock()
main.h
workspace.h
KWin::atoms
Atoms * atoms
Definition: main.cpp:69
QCoreApplication::exit
void exit(int returnCode)
KWin::Workspace::workspaceEvent
bool workspaceEvent(xcb_generic_event_t *)
Definition: events.cpp:141
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
KWin::Options
Definition: options.h:50
QCoreApplication::setApplicationVersion
void setApplicationVersion(const QString &version)
KWin::Application
Definition: main.h:55
KWin::Application::start
void start()
Definition: main.cpp:224
KWin::KWinSelectionOwner::KWinSelectionOwner
KWinSelectionOwner(int screen)
Definition: main.cpp:78
KWin::KWinSelectionOwner::replyTargets
virtual void replyTargets(xcb_atom_t property, xcb_window_t requestor)
Definition: main.cpp:114
QX11Info::appScreen
int appScreen()
KWin::KWinSelectionOwner
Definition: main.h:40
KWin::Application::wasCrash
static bool wasCrash()
Definition: main.cpp:375
QObject
QScopedPointer
QByteArray::constData
const char * constData() const
QByteArray::number
QByteArray number(int n, int base)
QVBoxLayout
KWin::Application::setOperationMode
void setOperationMode(OperationMode mode)
Definition: main.cpp:209
KWin::Workspace::self
static Workspace * self()
Definition: workspace.h:67
QString
QList
QCoreApplication::quit
void quit()
QDialog::accept
virtual void accept()
KWin::Xcb::setInputFocus
static void setInputFocus(xcb_window_t window, uint8_t revertTo=XCB_INPUT_FOCUS_POINTER_ROOT, xcb_timestamp_t time=xTime())
Definition: xcbutils.h:886
KWin::Application::Application
Application(int &argc, char **argv)
Definition: main.cpp:184
KWin::Application::~Application
~Application()
Definition: main.cpp:291
KWin::Application::crashHandler
static void crashHandler(int signal)
Definition: main.cpp:352
KWin::Xcb::sync
static void sync()
Definition: xcbutils.h:897
KWin::Application::notify
bool notify(QObject *o, QEvent *e)
Definition: main.cpp:340
KWin::Application::setConfigLock
void setConfigLock(bool lock)
Definition: main.cpp:194
QScopedPointer::isNull
bool isNull() const
KWin::Application::requiresCompositing
bool requiresCompositing() const
Definition: main.cpp:219
KWin::SessionSaveDoneHelper
Definition: sm.h:85
QApplication::exec
int exec()
QDBusMessage
QApplication::isSessionRestored
bool isSessionRestored() const
KWin::Xcb::selectInput
static void selectInput(xcb_window_t window, uint32_t events)
Definition: xcbutils.h:908
QCoreApplication::sendPostedEvents
void sendPostedEvents()
KWin::Atoms::retrieveHelpers
void retrieveHelpers()
Definition: atoms.cpp:68
QDialogButtonBox
QString::sprintf
QString & sprintf(const char *cformat,...)
xcb_window_t
QString::length
int length() const
QByteArray::data
char * data()
QString::left
QString left(int n) const
description
static const char description[]
Definition: main.cpp:396
QDBusConnection::asyncCall
QDBusPendingCall asyncCall(const QDBusMessage &message, int timeout) const
QDialog
QDBusMessage::setArguments
void setArguments(const QList< QVariant > &arguments)
QDialogButtonBox::button
QPushButton * button(StandardButton which) const
QDBusConnectionInterface::registerService
QDBusReply< QDBusConnectionInterface::RegisterServiceReply > registerService(const QString &serviceName, ServiceQueueOptions qoption, ServiceReplacementOptions roption)
QDialogButtonBox::accepted
void accepted()
options.h
KWin::KWinSelectionOwner::genericReply
virtual bool genericReply(xcb_atom_t target, xcb_atom_t property, xcb_window_t requestor)
Definition: main.cpp:123
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QLabel
QApplication::notify
virtual bool notify(QObject *receiver, QEvent *e)
QByteArray::remove
QByteArray & remove(int pos, int len)
QPushButton::setDefault
void setDefault(bool)
QDBusMessage::createMethodCall
QDBusMessage createMethodCall(const QString &service, const QString &path, const QString &interface, const QString &method)
KWin::Application::setReplace
void setReplace(bool replace)
Definition: main.cpp:199
QFile::encodeName
QByteArray encodeName(const QString &fileName)
QString::toAscii
QByteArray toAscii() const
QCoreApplication::setApplicationName
void setApplicationName(const QString &application)
QCoreApplication::applicationFilePath
QString applicationFilePath()
version
static const char version[]
Definition: main.cpp:395
QTimer::singleShot
singleShot
KWin::is_multihead
bool is_multihead
checks whether the X Window with the input focus is on our X11 screen if the window cannot be determi...
Definition: compositingprefs.cpp:40
KWin::sighandler
static void sighandler(int)
Definition: main.cpp:347
QComboBox
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Sun Dec 8 2019 03:18:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KWin

Skip menu "KWin"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kde-workspace API Reference

Skip menu "kde-workspace API Reference"
  • KWin
  •   KWin Decoration Library
  •   KWin Effects Library
  • Plasma
  • Plasma
  •   Applets
  •   Engines
  •   libkworkspace
  •   libtaskmanager
  • System Settings
  •   SystemSettingsView

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal