Changeset View
Changeset View
Standalone View
Standalone View
abstract_client.h
Show First 20 Lines • Show All 258 Lines • ▼ Show 20 Line(s) | 62 | { | |||
---|---|---|---|---|---|
259 | * | 259 | * | ||
260 | * The application's desktop file name can also be the full path to the desktop file | 260 | * The application's desktop file name can also be the full path to the desktop file | ||
261 | * (e.g. "/opt/kde/share/org.kde.foo.desktop") in case it's not in a standard location. | 261 | * (e.g. "/opt/kde/share/org.kde.foo.desktop") in case it's not in a standard location. | ||
262 | **/ | 262 | **/ | ||
263 | Q_PROPERTY(QByteArray desktopFileName READ desktopFileName NOTIFY desktopFileNameChanged) | 263 | Q_PROPERTY(QByteArray desktopFileName READ desktopFileName NOTIFY desktopFileNameChanged) | ||
264 | 264 | | |||
265 | /** | 265 | /** | ||
266 | * Whether an application menu is available for this Client | 266 | * Whether an application menu is available for this Client | ||
267 | */ | 267 | **/ | ||
268 | Q_PROPERTY(bool hasApplicationMenu READ hasApplicationMenu NOTIFY hasApplicationMenuChanged) | 268 | Q_PROPERTY(bool hasApplicationMenu READ hasApplicationMenu NOTIFY hasApplicationMenuChanged) | ||
269 | /** | 269 | /** | ||
270 | * Whether the application menu for this Client is currently opened | 270 | * Whether the application menu for this Client is currently opened | ||
271 | */ | 271 | **/ | ||
272 | Q_PROPERTY(bool applicationMenuActive READ applicationMenuActive NOTIFY applicationMenuActiveChanged) | 272 | Q_PROPERTY(bool applicationMenuActive READ applicationMenuActive NOTIFY applicationMenuActiveChanged) | ||
273 | 273 | | |||
274 | /** | 274 | /** | ||
275 | * Whether this client is unresponsive. | 275 | * Whether this client is unresponsive. | ||
276 | * | 276 | * | ||
277 | * When an application failed to react on a ping request in time, it is | 277 | * When an application failed to react on a ping request in time, it is | ||
278 | * considered unresponsive. This usually indicates that the application froze or crashed. | 278 | * considered unresponsive. This usually indicates that the application froze or crashed. | ||
279 | */ | 279 | **/ | ||
280 | Q_PROPERTY(bool unresponsive READ unresponsive NOTIFY unresponsiveChanged) | 280 | Q_PROPERTY(bool unresponsive READ unresponsive NOTIFY unresponsiveChanged) | ||
281 | /** | 281 | /** | ||
282 | * The "Window Tabs" Group this Client belongs to. | 282 | * The "Window Tabs" Group this Client belongs to. | ||
283 | **/ | 283 | **/ | ||
284 | Q_PROPERTY(KWin::TabGroup* tabGroup READ tabGroup NOTIFY tabGroupChanged SCRIPTABLE false) | 284 | Q_PROPERTY(KWin::TabGroup* tabGroup READ tabGroup NOTIFY tabGroupChanged SCRIPTABLE false) | ||
285 | 285 | | |||
286 | /** | 286 | /** | ||
287 | * The color scheme set on this client | 287 | * The color scheme set on this client | ||
288 | * Absolute file path, or name of palette in the user's config directory following KColorSchemes format. | 288 | * Absolute file path, or name of palette in the user's config directory following KColorSchemes format. | ||
289 | * An empty string indicates the default palette from kdeglobals is used. | 289 | * An empty string indicates the default palette from kdeglobals is used. | ||
290 | * @note this indicates the colour scheme requested, which might differ from the theme applied if the colorScheme cannot be found | 290 | * @note this indicates the colour scheme requested, which might differ from the theme applied if the colorScheme cannot be found | ||
291 | */ | 291 | **/ | ||
292 | Q_PROPERTY(QString colorScheme READ colorScheme NOTIFY colorSchemeChanged) | 292 | Q_PROPERTY(QString colorScheme READ colorScheme NOTIFY colorSchemeChanged) | ||
293 | 293 | | |||
294 | public: | 294 | public: | ||
295 | virtual ~AbstractClient(); | 295 | virtual ~AbstractClient(); | ||
296 | 296 | | |||
297 | QWeakPointer<TabBox::TabBoxClientImpl> tabBoxClient() const { | 297 | QWeakPointer<TabBox::TabBoxClientImpl> tabBoxClient() const { | ||
298 | return m_tabBoxClient.toWeakRef(); | 298 | return m_tabBoxClient.toWeakRef(); | ||
299 | } | 299 | } | ||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | |||||
413 | virtual void removeTransient(AbstractClient* cl); | 413 | virtual void removeTransient(AbstractClient* cl); | ||
414 | virtual QList<AbstractClient*> mainClients() const; // Call once before loop , is not indirect | 414 | virtual QList<AbstractClient*> mainClients() const; // Call once before loop , is not indirect | ||
415 | QList<AbstractClient*> allMainClients() const; // Call once before loop , is indirect | 415 | QList<AbstractClient*> allMainClients() const; // Call once before loop , is indirect | ||
416 | /** | 416 | /** | ||
417 | * Returns true for "special" windows and false for windows which are "normal" | 417 | * Returns true for "special" windows and false for windows which are "normal" | ||
418 | * (normal=window which has a border, can be moved by the user, can be closed, etc.) | 418 | * (normal=window which has a border, can be moved by the user, can be closed, etc.) | ||
419 | * true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now) | 419 | * true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now) | ||
420 | * false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO | 420 | * false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO | ||
421 | */ | 421 | **/ | ||
422 | bool isSpecialWindow() const; | 422 | bool isSpecialWindow() const; | ||
423 | void sendToScreen(int screen); | 423 | void sendToScreen(int screen); | ||
424 | const QKeySequence &shortcut() const { | 424 | const QKeySequence &shortcut() const { | ||
425 | return _shortcut; | 425 | return _shortcut; | ||
426 | } | 426 | } | ||
427 | void setShortcut(const QString &cut); | 427 | void setShortcut(const QString &cut); | ||
428 | virtual bool performMouseCommand(Options::MouseCommand, const QPoint &globalPos); | 428 | virtual bool performMouseCommand(Options::MouseCommand, const QPoint &globalPos); | ||
429 | void setOnAllDesktops(bool set); | 429 | void setOnAllDesktops(bool set); | ||
430 | void setDesktop(int); | 430 | void setDesktop(int); | ||
431 | void enterDesktop(VirtualDesktop *desktop); | 431 | void enterDesktop(VirtualDesktop *desktop); | ||
432 | void leaveDesktop(VirtualDesktop *desktop); | 432 | void leaveDesktop(VirtualDesktop *desktop); | ||
433 | 433 | | |||
434 | /** | 434 | /** | ||
435 | * Set the window as being on the attached list of desktops | 435 | * Set the window as being on the attached list of desktops | ||
436 | * On X11 it will be set to the last entry | 436 | * On X11 it will be set to the last entry | ||
437 | */ | 437 | **/ | ||
438 | void setDesktops(QVector<VirtualDesktop *> desktops); | 438 | void setDesktops(QVector<VirtualDesktop *> desktops); | ||
439 | 439 | | |||
440 | int desktop() const override { | 440 | int desktop() const override { | ||
441 | return m_desktops.isEmpty() ? (int)NET::OnAllDesktops : m_desktops.last()->x11DesktopNumber(); | 441 | return m_desktops.isEmpty() ? (int)NET::OnAllDesktops : m_desktops.last()->x11DesktopNumber(); | ||
442 | } | 442 | } | ||
443 | virtual QVector<VirtualDesktop *> desktops() const { | 443 | virtual QVector<VirtualDesktop *> desktops() const { | ||
444 | return m_desktops; | 444 | return m_desktops; | ||
445 | } | 445 | } | ||
446 | QVector<uint> x11DesktopIds() const; | 446 | QVector<uint> x11DesktopIds() const; | ||
447 | 447 | | |||
448 | void setMinimized(bool set); | 448 | void setMinimized(bool set); | ||
449 | /** | 449 | /** | ||
450 | * Minimizes this client plus its transients | 450 | * Minimizes this client plus its transients | ||
451 | */ | 451 | **/ | ||
452 | void minimize(bool avoid_animation = false); | 452 | void minimize(bool avoid_animation = false); | ||
453 | void unminimize(bool avoid_animation = false); | 453 | void unminimize(bool avoid_animation = false); | ||
454 | bool isMinimized() const { | 454 | bool isMinimized() const { | ||
455 | return m_minimized; | 455 | return m_minimized; | ||
456 | } | 456 | } | ||
457 | virtual void setFullScreen(bool set, bool user = true) = 0; | 457 | virtual void setFullScreen(bool set, bool user = true) = 0; | ||
458 | // Tabbing functions | 458 | // Tabbing functions | ||
459 | Q_INVOKABLE inline bool tabBefore(AbstractClient *other, bool activate) { return tabTo(other, false, activate); } | 459 | Q_INVOKABLE inline bool tabBefore(AbstractClient *other, bool activate) { return tabTo(other, false, activate); } | ||
460 | Q_INVOKABLE inline bool tabBehind(AbstractClient *other, bool activate) { return tabTo(other, true, activate); } | 460 | Q_INVOKABLE inline bool tabBehind(AbstractClient *other, bool activate) { return tabTo(other, true, activate); } | ||
461 | /** | 461 | /** | ||
462 | * Syncs the *dynamic* @p property @p fromThisClient or the currentTab() to | 462 | * Syncs the *dynamic* @p property @p fromThisClient or the currentTab() to | ||
463 | * all members of the tabGroup() (if there is one) | 463 | * all members of the tabGroup() (if there is one) | ||
464 | * | 464 | * | ||
465 | * eg. if you call: | 465 | * eg. if you call: | ||
466 | * @code | 466 | * @code | ||
467 | * client->setProperty("kwin_tiling_floats", true); | 467 | * client->setProperty("kwin_tiling_floats", true); | ||
468 | * client->syncTabGroupFor("kwin_tiling_floats", true) | 468 | * client->syncTabGroupFor("kwin_tiling_floats", true) | ||
469 | * @endcode | 469 | * @endcode | ||
470 | * all clients in this tabGroup will have property("kwin_tiling_floats").toBool() == true | 470 | * all clients in this tabGroup will have property("kwin_tiling_floats").toBool() == true | ||
471 | * | 471 | * | ||
472 | * WARNING: non dynamic properties are ignored - you're not supposed to alter/update such explicitly | 472 | * WARNING: non dynamic properties are ignored - you're not supposed to alter/update such explicitly | ||
473 | */ | 473 | **/ | ||
474 | Q_INVOKABLE void syncTabGroupFor(QString property, bool fromThisClient = false); | 474 | Q_INVOKABLE void syncTabGroupFor(QString property, bool fromThisClient = false); | ||
475 | TabGroup *tabGroup() const; | 475 | TabGroup *tabGroup() const; | ||
476 | /** | 476 | /** | ||
477 | * Set tab group - this is to be invoked by TabGroup::add/remove(client) and NO ONE ELSE | 477 | * Set tab group - this is to be invoked by TabGroup::add/remove(client) and NO ONE ELSE | ||
478 | */ | 478 | **/ | ||
479 | void setTabGroup(TabGroup* group); | 479 | void setTabGroup(TabGroup* group); | ||
480 | virtual void setClientShown(bool shown); | 480 | virtual void setClientShown(bool shown); | ||
481 | Q_INVOKABLE bool untab(const QRect &toGeometry = QRect(), bool clientRemoved = false); | 481 | Q_INVOKABLE bool untab(const QRect &toGeometry = QRect(), bool clientRemoved = false); | ||
482 | /* | 482 | /** | ||
483 | * When a click is done in the decoration and it calls the group | 483 | * When a click is done in the decoration and it calls the group | ||
484 | * to change the visible client it starts to move-resize the new | 484 | * to change the visible client it starts to move-resize the new | ||
485 | * client, this function stops it. | 485 | * client, this function stops it. | ||
486 | */ | 486 | **/ | ||
487 | bool isCurrentTab() const; | 487 | bool isCurrentTab() const; | ||
488 | virtual QRect geometryRestore() const = 0; | 488 | virtual QRect geometryRestore() const = 0; | ||
489 | /** | 489 | /** | ||
490 | * The currently applied maximize mode | 490 | * The currently applied maximize mode | ||
491 | */ | 491 | **/ | ||
492 | virtual MaximizeMode maximizeMode() const = 0; | 492 | virtual MaximizeMode maximizeMode() const = 0; | ||
493 | /** | 493 | /** | ||
494 | * The maximise mode requested by the server. | 494 | * The maximise mode requested by the server. | ||
495 | * For X this always matches maximizeMode, for wayland clients it | 495 | * For X this always matches maximizeMode, for wayland clients it | ||
496 | * is asyncronous | 496 | * is asyncronous | ||
497 | */ | 497 | **/ | ||
498 | virtual MaximizeMode requestedMaximizeMode() const; | 498 | virtual MaximizeMode requestedMaximizeMode() const; | ||
499 | void maximize(MaximizeMode); | 499 | void maximize(MaximizeMode); | ||
500 | /** | ||||
501 | * Sets the maximization according to @p vertically and @p horizontally. | ||||
502 | **/ | ||||
500 | void setMaximize(bool vertically, bool horizontally); | 503 | void setMaximize(bool vertically, bool horizontally); | ||
501 | virtual bool noBorder() const = 0; | 504 | virtual bool noBorder() const = 0; | ||
502 | virtual void setNoBorder(bool set) = 0; | 505 | virtual void setNoBorder(bool set) = 0; | ||
503 | virtual void blockActivityUpdates(bool b = true) = 0; | 506 | virtual void blockActivityUpdates(bool b = true) = 0; | ||
504 | QPalette palette() const; | 507 | QPalette palette() const; | ||
505 | const Decoration::DecorationPalette *decorationPalette() const; | 508 | const Decoration::DecorationPalette *decorationPalette() const; | ||
509 | /** | ||||
510 | * Returns whether the window is resizable or has a fixed size. | ||||
511 | **/ | ||||
506 | virtual bool isResizable() const = 0; | 512 | virtual bool isResizable() const = 0; | ||
513 | /** | ||||
514 | * Returns whether the window is moveable or has a fixed position. | ||||
515 | **/ | ||||
507 | virtual bool isMovable() const = 0; | 516 | virtual bool isMovable() const = 0; | ||
517 | /** | ||||
518 | * Returns whether the window can be moved to another screen. | ||||
519 | **/ | ||||
508 | virtual bool isMovableAcrossScreens() const = 0; | 520 | virtual bool isMovableAcrossScreens() const = 0; | ||
509 | /** | 521 | /** | ||
510 | * @c true only for @c ShadeNormal | 522 | * @c true only for @c ShadeNormal | ||
511 | **/ | 523 | **/ | ||
512 | bool isShade() const { | 524 | bool isShade() const { | ||
513 | return shadeMode() == ShadeNormal; | 525 | return shadeMode() == ShadeNormal; | ||
514 | } | 526 | } | ||
515 | /** | 527 | /** | ||
516 | * Default implementation returns @c ShadeNone | 528 | * Default implementation returns @c ShadeNone | ||
517 | **/ | 529 | **/ | ||
518 | virtual ShadeMode shadeMode() const; // Prefer isShade() | 530 | virtual ShadeMode shadeMode() const; // Prefer isShade() | ||
519 | void setShade(bool set); | 531 | void setShade(bool set); | ||
520 | /** | 532 | /** | ||
521 | * Default implementation does nothing | 533 | * Default implementation does nothing | ||
522 | **/ | 534 | **/ | ||
523 | virtual void setShade(ShadeMode mode); | 535 | virtual void setShade(ShadeMode mode); | ||
524 | /** | 536 | /** | ||
525 | * Whether the Client can be shaded. Default implementation returns @c false. | 537 | * Whether the Client can be shaded. Default implementation returns @c false. | ||
526 | **/ | 538 | **/ | ||
527 | virtual bool isShadeable() const; | 539 | virtual bool isShadeable() const; | ||
540 | /** | ||||
541 | * Returns whether the window is maximizable or not. | ||||
542 | **/ | ||||
528 | virtual bool isMaximizable() const = 0; | 543 | virtual bool isMaximizable() const = 0; | ||
529 | virtual bool isMinimizable() const = 0; | 544 | virtual bool isMinimizable() const = 0; | ||
530 | virtual QRect iconGeometry() const; | 545 | virtual QRect iconGeometry() const; | ||
531 | virtual bool userCanSetFullScreen() const = 0; | 546 | virtual bool userCanSetFullScreen() const = 0; | ||
532 | virtual bool userCanSetNoBorder() const = 0; | 547 | virtual bool userCanSetNoBorder() const = 0; | ||
533 | virtual void checkNoBorder(); | 548 | virtual void checkNoBorder(); | ||
534 | virtual void setOnActivities(QStringList newActivitiesList); | 549 | virtual void setOnActivities(QStringList newActivitiesList); | ||
535 | virtual void setOnAllActivities(bool set) = 0; | 550 | virtual void setOnAllActivities(bool set) = 0; | ||
Show All 33 Lines | |||||
569 | void endMoveResize(); | 584 | void endMoveResize(); | ||
570 | void keyPressEvent(uint key_code); | 585 | void keyPressEvent(uint key_code); | ||
571 | 586 | | |||
572 | void enterEvent(const QPoint &globalPos); | 587 | void enterEvent(const QPoint &globalPos); | ||
573 | void leaveEvent(); | 588 | void leaveEvent(); | ||
574 | 589 | | |||
575 | /** | 590 | /** | ||
576 | * These values represent positions inside an area | 591 | * These values represent positions inside an area | ||
577 | */ | 592 | **/ | ||
578 | enum Position { | 593 | enum Position { | ||
579 | // without prefix, they'd conflict with Qt::TopLeftCorner etc. :( | 594 | // without prefix, they'd conflict with Qt::TopLeftCorner etc. :( | ||
580 | PositionCenter = 0x00, | 595 | PositionCenter = 0x00, | ||
581 | PositionLeft = 0x01, | 596 | PositionLeft = 0x01, | ||
582 | PositionRight = 0x02, | 597 | PositionRight = 0x02, | ||
583 | PositionTop = 0x04, | 598 | PositionTop = 0x04, | ||
584 | PositionBottom = 0x08, | 599 | PositionBottom = 0x08, | ||
585 | PositionTopLeft = PositionLeft | PositionTop, | 600 | PositionTopLeft = PositionLeft | PositionTop, | ||
586 | PositionTopRight = PositionRight | PositionTop, | 601 | PositionTopRight = PositionRight | PositionTop, | ||
587 | PositionBottomLeft = PositionLeft | PositionBottom, | 602 | PositionBottomLeft = PositionLeft | PositionBottom, | ||
588 | PositionBottomRight = PositionRight | PositionBottom | 603 | PositionBottomRight = PositionRight | PositionBottom | ||
589 | }; | 604 | }; | ||
590 | Position titlebarPosition() const; | 605 | Position titlebarPosition() const; | ||
591 | bool titlebarPositionUnderMouse() const; | 606 | bool titlebarPositionUnderMouse() const; | ||
592 | 607 | | |||
593 | // a helper for the workspace window packing. tests for screen validity and updates since in maximization case as with normal moving | 608 | // a helper for the workspace window packing. tests for screen validity and updates since in maximization case as with normal moving | ||
594 | void packTo(int left, int top); | 609 | void packTo(int left, int top); | ||
595 | 610 | | |||
596 | /** Set the quick tile mode ("snap") of this window. | 611 | /** | ||
612 | * Sets the quick tile mode ("snap") of this window. | ||||
597 | * This will also handle preserving and restoring of window geometry as necessary. | 613 | * This will also handle preserving and restoring of window geometry as necessary. | ||
598 | * @param mode The tile mode (left/right) to give this window. | 614 | * @param mode The tile mode (left/right) to give this window. | ||
599 | * @param keyboard Defines whether to take keyboard cursor into account. | 615 | * @param keyboard Defines whether to take keyboard cursor into account. | ||
600 | */ | 616 | **/ | ||
601 | void setQuickTileMode(QuickTileMode mode, bool keyboard = false); | 617 | void setQuickTileMode(QuickTileMode mode, bool keyboard = false); | ||
602 | QuickTileMode quickTileMode() const { | 618 | QuickTileMode quickTileMode() const { | ||
603 | return QuickTileMode(m_quickTileMode); | 619 | return QuickTileMode(m_quickTileMode); | ||
604 | } | 620 | } | ||
605 | Layer layer() const override; | 621 | Layer layer() const override; | ||
606 | void updateLayer(); | 622 | void updateLayer(); | ||
607 | 623 | | |||
608 | enum ForceGeometry_t { NormalGeometrySet, ForceGeometrySet }; | 624 | enum ForceGeometry_t { NormalGeometrySet, ForceGeometrySet }; | ||
Show All 9 Lines | |||||
618 | /// How to resize the window in order to obey constains (mainly aspect ratios) | 634 | /// How to resize the window in order to obey constains (mainly aspect ratios) | ||
619 | enum Sizemode { | 635 | enum Sizemode { | ||
620 | SizemodeAny, | 636 | SizemodeAny, | ||
621 | SizemodeFixedW, ///< Try not to affect width | 637 | SizemodeFixedW, ///< Try not to affect width | ||
622 | SizemodeFixedH, ///< Try not to affect height | 638 | SizemodeFixedH, ///< Try not to affect height | ||
623 | SizemodeMax ///< Try not to make it larger in either direction | 639 | SizemodeMax ///< Try not to make it larger in either direction | ||
624 | }; | 640 | }; | ||
625 | /** | 641 | /** | ||
626 | *Calculate the appropriate frame size for the given client size @p wsize. | 642 | * Calculates the appropriate frame size for the given client size @p wsize. | ||
627 | * | 643 | * | ||
628 | * @p wsize is adapted according to the window's size hints (minimum, maximum and incremental size changes). | 644 | * @p wsize is adapted according to the window's size hints (minimum, maximum and incremental size changes). | ||
629 | * | 645 | * | ||
630 | * Default implementation returns the passed in @p wsize. | 646 | * Default implementation returns the passed in @p wsize. | ||
631 | */ | 647 | **/ | ||
632 | virtual QSize sizeForClientSize(const QSize &wsize, Sizemode mode = SizemodeAny, bool noframe = false) const; | 648 | virtual QSize sizeForClientSize(const QSize &wsize, Sizemode mode = SizemodeAny, bool noframe = false) const; | ||
633 | 649 | | |||
650 | /** | ||||
651 | * Adjust the frame size @p frame according to the window's size hints. | ||||
652 | **/ | ||||
634 | QSize adjustedSize(const QSize&, Sizemode mode = SizemodeAny) const; | 653 | QSize adjustedSize(const QSize&, Sizemode mode = SizemodeAny) const; | ||
635 | QSize adjustedSize() const; | 654 | QSize adjustedSize() const; | ||
636 | 655 | | |||
637 | bool isMove() const { | 656 | bool isMove() const { | ||
638 | return isMoveResize() && moveResizePointerMode() == PositionCenter; | 657 | return isMoveResize() && moveResizePointerMode() == PositionCenter; | ||
639 | } | 658 | } | ||
640 | bool isResize() const { | 659 | bool isResize() const { | ||
641 | return isMoveResize() && moveResizePointerMode() != PositionCenter; | 660 | return isMoveResize() && moveResizePointerMode() != PositionCenter; | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
688 | 707 | | |||
689 | /** | 708 | /** | ||
690 | * Returns whether the window provides context help or not. If it does, | 709 | * Returns whether the window provides context help or not. If it does, | ||
691 | * you should show a help menu item or a help button like '?' and call | 710 | * you should show a help menu item or a help button like '?' and call | ||
692 | * contextHelp() if this is invoked. | 711 | * contextHelp() if this is invoked. | ||
693 | * | 712 | * | ||
694 | * Default implementation returns @c false. | 713 | * Default implementation returns @c false. | ||
695 | * @see showContextHelp; | 714 | * @see showContextHelp; | ||
696 | */ | 715 | **/ | ||
697 | virtual bool providesContextHelp() const; | 716 | virtual bool providesContextHelp() const; | ||
698 | 717 | | |||
699 | /** | 718 | /** | ||
700 | * Invokes context help on the window. Only works if the window | 719 | * Invokes context help on the window. Only works if the window | ||
701 | * actually provides context help. | 720 | * actually provides context help. | ||
702 | * | 721 | * | ||
703 | * Default implementation does nothing. | 722 | * Default implementation does nothing. | ||
704 | * | 723 | * | ||
705 | * @see providesContextHelp() | 724 | * @see providesContextHelp() | ||
706 | */ | 725 | **/ | ||
707 | virtual void showContextHelp(); | 726 | virtual void showContextHelp(); | ||
708 | 727 | | |||
709 | QRect inputGeometry() const override; | 728 | QRect inputGeometry() const override; | ||
710 | 729 | | |||
711 | /** | 730 | /** | ||
712 | * Restores the AbstractClient after it had been hidden due to show on screen edge functionality. | 731 | * Restores the AbstractClient after it had been hidden due to show on screen edge functionality. | ||
713 | * The AbstractClient also gets raised (e.g. Panel mode windows can cover) and the AbstractClient | 732 | * The AbstractClient also gets raised (e.g. Panel mode windows can cover) and the AbstractClient | ||
714 | * gets informed in a window specific way that it is shown and raised again. | 733 | * gets informed in a window specific way that it is shown and raised again. | ||
Show All 32 Lines | |||||
747 | } | 766 | } | ||
748 | QString colorScheme() const { | 767 | QString colorScheme() const { | ||
749 | return m_colorScheme; | 768 | return m_colorScheme; | ||
750 | } | 769 | } | ||
751 | 770 | | |||
752 | /** | 771 | /** | ||
753 | * Request showing the application menu bar | 772 | * Request showing the application menu bar | ||
754 | * @param actionId The DBus menu ID of the action that should be highlighted, 0 for the root menu | 773 | * @param actionId The DBus menu ID of the action that should be highlighted, 0 for the root menu | ||
755 | */ | 774 | **/ | ||
756 | void showApplicationMenu(int actionId); | 775 | void showApplicationMenu(int actionId); | ||
757 | 776 | | |||
758 | bool unresponsive() const; | 777 | bool unresponsive() const; | ||
759 | 778 | | |||
760 | virtual bool isInitialPositionSet() const { | 779 | virtual bool isInitialPositionSet() const { | ||
761 | return false; | 780 | return false; | ||
762 | } | 781 | } | ||
763 | 782 | | |||
▲ Show 20 Lines • Show All 270 Lines • ▼ Show 20 Line(s) | 1052 | void setMoveResizePointerButtonDown(bool down) { | |||
1034 | m_moveResize.buttonDown = down; | 1053 | m_moveResize.buttonDown = down; | ||
1035 | } | 1054 | } | ||
1036 | int moveResizeStartScreen() const { | 1055 | int moveResizeStartScreen() const { | ||
1037 | return m_moveResize.startScreen; | 1056 | return m_moveResize.startScreen; | ||
1038 | } | 1057 | } | ||
1039 | void checkUnrestrictedMoveResize(); | 1058 | void checkUnrestrictedMoveResize(); | ||
1040 | /** | 1059 | /** | ||
1041 | * Sets an appropriate cursor shape for the logical mouse position. | 1060 | * Sets an appropriate cursor shape for the logical mouse position. | ||
1042 | */ | 1061 | **/ | ||
1043 | void updateCursor(); | 1062 | void updateCursor(); | ||
1044 | void startDelayedMoveResize(); | 1063 | void startDelayedMoveResize(); | ||
1045 | void stopDelayedMoveResize(); | 1064 | void stopDelayedMoveResize(); | ||
1046 | bool startMoveResize(); | 1065 | bool startMoveResize(); | ||
1047 | /** | 1066 | /** | ||
1048 | * Called from startMoveResize. | 1067 | * Called from startMoveResize. | ||
1049 | * | 1068 | * | ||
1050 | * Implementing classes should return @c false if starting move resize should | 1069 | * Implementing classes should return @c false if starting move resize should | ||
Show All 17 Lines | |||||
1068 | * Implementing subclasses can perform windowing system specific handling here. | 1087 | * Implementing subclasses can perform windowing system specific handling here. | ||
1069 | * | 1088 | * | ||
1070 | * Default implementation does nothing. | 1089 | * Default implementation does nothing. | ||
1071 | **/ | 1090 | **/ | ||
1072 | virtual void doPerformMoveResize(); | 1091 | virtual void doPerformMoveResize(); | ||
1073 | /* | 1092 | /* | ||
1074 | * Checks if the mouse cursor is near the edge of the screen and if so | 1093 | * Checks if the mouse cursor is near the edge of the screen and if so | ||
1075 | * activates quick tiling or maximization | 1094 | * activates quick tiling or maximization | ||
1076 | */ | 1095 | **/ | ||
1077 | void checkQuickTilingMaximizationZones(int xroot, int yroot); | 1096 | void checkQuickTilingMaximizationZones(int xroot, int yroot); | ||
1078 | /** | 1097 | /** | ||
1079 | * Whether a sync request is still pending. | 1098 | * Whether a sync request is still pending. | ||
1080 | * Default implementation returns @c false. | 1099 | * Default implementation returns @c false. | ||
1081 | **/ | 1100 | **/ | ||
1082 | virtual bool isWaitingForMoveResizeSync() const; | 1101 | virtual bool isWaitingForMoveResizeSync() const; | ||
1083 | /** | 1102 | /** | ||
1084 | * Called during handling a resize. Implementing subclasses can use this | 1103 | * Called during handling a resize. Implementing subclasses can use this | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 1159 | private: | |||
1167 | AbstractClient *m_transientFor = nullptr; | 1186 | AbstractClient *m_transientFor = nullptr; | ||
1168 | QList<AbstractClient*> m_transients; | 1187 | QList<AbstractClient*> m_transients; | ||
1169 | bool m_modal = false; | 1188 | bool m_modal = false; | ||
1170 | Layer m_layer = UnknownLayer; | 1189 | Layer m_layer = UnknownLayer; | ||
1171 | 1190 | | |||
1172 | // electric border/quick tiling | 1191 | // electric border/quick tiling | ||
1173 | QuickTileMode m_electricMode = QuickTileFlag::None; | 1192 | QuickTileMode m_electricMode = QuickTileFlag::None; | ||
1174 | bool m_electricMaximizing = false; | 1193 | bool m_electricMaximizing = false; | ||
1175 | /** The quick tile mode of this window. | 1194 | // The quick tile mode of this window. | ||
1176 | */ | | |||
1177 | int m_quickTileMode = int(QuickTileFlag::None); | 1195 | int m_quickTileMode = int(QuickTileFlag::None); | ||
1178 | QTimer *m_electricMaximizingDelay = nullptr; | 1196 | QTimer *m_electricMaximizingDelay = nullptr; | ||
1179 | 1197 | | |||
1180 | // geometry | 1198 | // geometry | ||
1181 | int m_blockGeometryUpdates = 0; // > 0 = New geometry is remembered, but not actually set | 1199 | int m_blockGeometryUpdates = 0; // > 0 = New geometry is remembered, but not actually set | ||
1182 | PendingGeometry_t m_pendingGeometryUpdate = PendingGeometryNone; | 1200 | PendingGeometry_t m_pendingGeometryUpdate = PendingGeometryNone; | ||
1183 | friend class GeometryUpdatesBlocker; | 1201 | friend class GeometryUpdatesBlocker; | ||
1184 | QRect m_visibleRectBeforeGeometryUpdate; | 1202 | QRect m_visibleRectBeforeGeometryUpdate; | ||
Show All 31 Lines | |||||
1216 | WindowRules m_rules; | 1234 | WindowRules m_rules; | ||
1217 | TabGroup* tab_group = nullptr; | 1235 | TabGroup* tab_group = nullptr; | ||
1218 | 1236 | | |||
1219 | static bool s_haveResizeEffect; | 1237 | static bool s_haveResizeEffect; | ||
1220 | }; | 1238 | }; | ||
1221 | 1239 | | |||
1222 | /** | 1240 | /** | ||
1223 | * Helper for AbstractClient::blockGeometryUpdates() being called in pairs (true/false) | 1241 | * Helper for AbstractClient::blockGeometryUpdates() being called in pairs (true/false) | ||
1224 | */ | 1242 | **/ | ||
1225 | class GeometryUpdatesBlocker | 1243 | class GeometryUpdatesBlocker | ||
1226 | { | 1244 | { | ||
1227 | public: | 1245 | public: | ||
1228 | explicit GeometryUpdatesBlocker(AbstractClient* c) | 1246 | explicit GeometryUpdatesBlocker(AbstractClient* c) | ||
1229 | : cl(c) { | 1247 | : cl(c) { | ||
1230 | cl->blockGeometryUpdates(true); | 1248 | cl->blockGeometryUpdates(true); | ||
1231 | } | 1249 | } | ||
1232 | ~GeometryUpdatesBlocker() { | 1250 | ~GeometryUpdatesBlocker() { | ||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |