36 auto* display = XWindowSystem::getInstance()->getDisplay();
38 auto*
screen = X11Symbols::getInstance()->xDefaultScreenOfDisplay (display);
45 X11Symbols::getInstance()->xGrabServer (display);
51 X11Symbols::getInstance()->xUngrabServer (display);
52 X11Symbols::getInstance()->xFlush (display);
59 ev.xclient.message_type = XWindowSystemUtilities::Atoms::getCreating (display,
"_NET_SYSTEM_TRAY_OPCODE");
60 ev.xclient.format = 32;
62 ev.xclient.data.l[1] = 0 ;
63 ev.xclient.data.l[2] = (
long) windowH;
64 ev.xclient.data.l[3] = 0;
65 ev.xclient.data.l[4] = 0;
68 X11Symbols::getInstance()->xSync (display, False);
73 Atom
trayAtom = XWindowSystemUtilities::Atoms::getCreating (display,
"KWM_DOCKWINDOW");
74 X11Symbols::getInstance()->xChangeProperty (display, windowH,
trayAtom,
trayAtom,
78 trayAtom = XWindowSystemUtilities::Atoms::getCreating (display,
"_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR");
79 X11Symbols::getInstance()->xChangeProperty (display, windowH,
trayAtom,
XA_WINDOW,
83 if (
auto*
hints = X11Symbols::getInstance()->xAllocSizeHints())
86 hints->min_width = 22;
87 hints->min_height = 22;
88 X11Symbols::getInstance()->xSetWMNormalHints (display, windowH,
hints);
89 X11Symbols::getInstance()->xFree (
hints);
121 if (pimpl !=
nullptr)
void * getWindowHandle() const
Returns the underlying native window handle for this component.
void toFront(bool shouldAlsoGainKeyboardFocus)
Brings the component to the front of its siblings.
void repaint()
Marks the whole component as needing to be redrawn.
bool isOnDesktop() const noexcept
Returns true if this component is currently showing on the desktop.
virtual void addToDesktop(int windowStyleFlags, void *nativeWindowToAttachTo=nullptr)
Makes this component appear as a window on the desktop.
Rectangle< int > getLocalBounds() const noexcept
Returns the component's bounds, relative to its own origin.
virtual void paint(Graphics &g)
Components can override this method to draw their content.
virtual void setVisible(bool shouldBeVisible)
Makes the component visible or invisible.
A graphics context, used for drawing a component or image.
void drawImage(const Image &imageToDraw, int destX, int destY, int destWidth, int destHeight, int sourceX, int sourceY, int sourceWidth, int sourceHeight, bool fillAlphaChannelWithCurrentBrush=false) const
Draws part of an image, rescaling it to fit in a given target region.
Holds a fixed-size bitmap.
@ onlyReduceInSize
Indicates that the source rectangle can be reduced in size if required, but should never be made larg...
@ yTop
Indicates that the source's top edge should be aligned with the top edge of the destination rectangle...
@ xLeft
Indicates that the source rectangle's left edge should be aligned with the left edge of the target re...
void setHighlighted(bool)
Highlights the icon (if the current OS supports this).
void showInfoBubble(const String &title, const String &content)
Shows a floating text bubble pointing to the icon (if the current OS supports this).
void setIconTooltip(const String &tooltip)
Changes the icon's tooltip (if the current OS supports this).
void setIconImage(const Image &colourImage, const Image &templateImage)
Changes the image shown in the taskbar.
void * getNativeHandle() const
Returns the raw handle to whatever kind of internal OS structure is involved in showing this icon.
void hideInfoBubble()
Hides the icon's floating text bubble (if the current OS supports this).
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
A handy struct that uses XLockDisplay and XUnlockDisplay to lock the X server using RAII.