59 #include "private/qmenu_p.h" 60 #include "private/qbackingstore_p.h" 61 #include "private/qwindowsurface_x11_p.h" 65 #include <private/qpixmap_x11_p.h> 66 #include <private/qpaintengine_x11_p.h> 79 #if !defined(QT_NO_IM) 86 #define XCOORD_MAX 16383 87 #define WRECT_MAX 8191 144 ulong nitems, bytesLeft;
169 if (mwmhints.
flags != 0
l) {
171 PropModeReplace, (
unsigned char *) &mwmhints, 5);
198 KeyPressMask | KeyReleaseMask |
199 ButtonPressMask | ButtonReleaseMask |
201 ButtonMotionMask | PointerMotionMask |
202 EnterWindowMask | LeaveWindowMask |
212 EnterWindowMask | LeaveWindowMask |
224 int borderwidth,
int depth,
225 uint windowclass, Visual *visual,
226 ulong valuemask, XSetWindowAttributes *attributes);
229 int x,
int y,
uint w,
uint h,
int borderwidth,
240 X11->sip_list.append(sip);
242 XClientMessageEvent client_message;
243 client_message.type = ClientMessage;
245 client_message.format = 32;
247 client_message.data.l[0] = sip.
id;
249 XSendEvent(
X11->display, scrolled_widget->
internalWinId(), False, NoEventMask,
250 (
XEvent*)&client_message);
257 for (
int i = 0; i <
X11->sip_list.size(); ++i) {
268 if (
X11->wm_client_leader)
return;
270 X11->wm_client_leader =
271 XCreateSimpleWindow(
X11->display,
273 0, 0, 1, 1, 0, 0, 0);
276 XChangeProperty(
X11->display,
278 XA_WINDOW, 32, PropModeReplace,
279 (
unsigned char *)&
X11->wm_client_leader, 1);
281 #ifndef QT_NO_SESSIONMANAGER 285 XChangeProperty(
X11->display,
287 XA_STRING, 8, PropModeReplace,
288 (
unsigned char *)session.
data(), session.
size());
334 XDefineCursor(
X11->display, winid, oc->
handle());
340 XDefineCursor(
X11->display, winid,
XNone);
344 XDefineCursor(
X11->display, winid,
XNone);
361 static const int maximumWaitTime = 2000;
368 if (sendPostedEvents)
381 if (XEventsQueued(
X11->display, QueuedAlready)) {
382 XNextEvent(
X11->display, &ev);
386 qApp->x11ProcessEvent(&ev);
390 if (ev.type == MapNotify && ev.xany.window == winid)
394 if (ev.type == Expose && ev.xany.window == winid)
400 if (!XEventsQueued(
X11->display, QueuedAfterFlush))
403 if (t.
elapsed() > maximumWaitTime)
419 e.xclient.type = ClientMessage;
421 e.xclient.display =
X11->display;
423 e.xclient.format = 32;
424 e.xclient.data.l[0] =
set ? 1 : 0;
425 e.xclient.data.l[1] = one;
426 e.xclient.data.l[2] = two;
427 e.xclient.data.l[3] = 0;
428 e.xclient.data.l[4] = 0;
430 false, (SubstructureNotifyMask | SubstructureRedirectMask), &e);
434 const XWindowAttributes *
att;
452 ulong propertyLength;
454 uchar *propertyData = 0;
456 False, XA_ATOM, &actualType, &actualFormat,
457 &propertyLength, &bytesLeft, &propertyData) ==
Success 458 && actualType == XA_ATOM && actualFormat == 32) {
459 returnValue.
resize(bytesLeft / 4);
460 XFree((
char*) propertyData);
465 returnValue.
size(), False, XA_ATOM, &actualType, &actualFormat,
466 &propertyLength, &bytesLeft, &propertyData) !=
Success) {
468 }
else if (propertyLength != (
ulong)returnValue.
size()) {
469 returnValue.
resize(propertyLength);
474 memcpy(returnValue.
data(), propertyData, returnValue.
size() *
sizeof(
Atom));
477 XFree((
char*) propertyData);
487 Qt::WindowFlags &
flags =
data.window_flags;
502 qDebug() <<
"QWidgetPrivate::create_sys START:" << q <<
"topLevel?" << topLevel <<
"WId:" 503 << window <<
"initializeWindow:" << initializeWindow <<
"destroyOldWindow" << destroyOldWindow;
527 Window parentw, destroyw = 0;
532 initializeWindow =
true;
534 QX11Info *parentXinfo = parentWidget ? &parentWidget->d_func()->xinfo : 0;
541 xinfo.setX11Data(xd);
542 }
else if (parentXinfo && (parentXinfo->
screen() != xinfo.screen()
543 || (parentXinfo->
visual() != xinfo.visual()
544 && !q->inherits(
"QGLWidget"))))
550 xinfo = *parentXinfo;
556 int scr = xinfo.screen();
557 Window root_win = RootWindow(dpy, scr);
558 int sw = DisplayWidth(dpy,scr);
559 int sh = DisplayHeight(dpy,scr);
563 data.crect.setRect(0, 0, sw, sh);
573 int height = 4 * sh / 10;
575 width =
qMax(
qMin(width, extra->maxw), extra->minw);
576 height =
qMax(
qMin(height, extra->maxh), extra->minh);
578 data.crect.setSize(
QSize(width, height));
583 XSetWindowAttributes wsa;
586 if (destroyOldWindow) {
588 X11->dndEnable(q,
false);
589 destroyw =
data.winid;
594 XGetWindowAttributes(dpy, window, &a);
595 data.crect.setRect(a.x, a.y, a.width, a.height);
597 if (a.map_state == IsUnmapped)
604 }
else if (desktop) {
605 #ifdef QWIDGET_EXTRA_DEBUG 606 qDebug() <<
"create desktop";
618 #ifdef QWIDGET_EXTRA_DEBUG 619 static int topLevels = 0;
620 static int children = 0;
621 if (parentw == root_win)
622 qDebug() <<
"create toplevel" << ++topLevels;
624 qDebug() <<
"create child" << ++children;
627 if (safeRect.
width() < 1|| safeRect.
height() < 1) {
634 safeRect =
QRect(-1000,-1000,1,1);
637 #ifndef QT_NO_XRENDER 638 int screen = xinfo.screen();
639 if (topLevel &&
X11->use_xrender
640 && xinfo.depth() != 32 &&
X11->argbVisuals[screen]
652 xinfo.setX11Data(xd);
655 if (xinfo.defaultVisual() && xinfo.defaultColormap()) {
657 safeRect.
left(), safeRect.
top(),
660 BlackPixel(dpy, xinfo.screen()),
661 WhitePixel(dpy, xinfo.screen()));
663 wsa.background_pixel = WhitePixel(dpy, xinfo.screen());
664 wsa.border_pixel = BlackPixel(dpy, xinfo.screen());
665 wsa.colormap = xinfo.colormap();
667 safeRect.
left(), safeRect.
top(),
669 0, xinfo.depth(), InputOutput,
670 (Visual *) xinfo.visual(),
671 CWBackPixel|CWBorderPixel|CWColormap,
678 #ifndef QT_NO_XRENDER 680 XRenderFreePicture(
X11->display, picture);
684 if (
X11->use_xrender && !desktop && q->internalWinId()) {
685 XRenderPictFormat *
format = XRenderFindVisualFormat(dpy, (Visual *) xinfo.visual());
687 picture = XRenderCreatePicture(dpy,
id, format, 0, 0);
689 #endif // QT_NO_XRENDER 708 if (flags & Qt::WindowTitleHint)
733 wsa.save_under = True;
734 wsa_mask |= CWSaveUnder;
738 wsa.override_redirect = True;
739 wsa_mask |= CWOverrideRedirect;
742 if (wsa_mask && initializeWindow) {
744 XChangeWindowAttributes(dpy,
id, wsa_mask, &wsa);
768 if (!initializeWindow) {
772 setNetWmWindowTypes();
774 wsa.override_redirect = True;
775 wsa.save_under = True;
777 XChangeWindowAttributes(dpy,
id, CWOverrideRedirect | CWSaveUnder,
779 }
else if (topLevel && !desktop) {
780 if (!
X11->wm_client_leader)
785 XSizeHints size_hints;
786 memset(&size_hints, 0,
sizeof(size_hints));
787 size_hints.flags = USSize | PSize | PWinGravity;
788 size_hints.x =
data.crect.left();
789 size_hints.y =
data.crect.top();
790 size_hints.width =
data.crect.width();
791 size_hints.height =
data.crect.height();
792 size_hints.win_gravity =
796 memset(&wm_hints, 0,
sizeof(wm_hints));
797 wm_hints.flags = InputHint | StateHint | WindowGroupHint;
799 wm_hints.initial_state = NormalState;
800 wm_hints.window_group =
X11->wm_client_leader;
802 XClassHint class_hint;
804 class_hint.res_name = appName.
data();
807 XSetWMProperties(dpy,
id, 0, 0,
808 qApp->d_func()->argv,
qApp->d_func()->argc,
809 &size_hints, &wm_hints, &class_hint);
811 XResizeWindow(dpy,
id,
814 XStoreName(dpy,
id, appName.
data());
822 #endif // QT_NO_XSYNC 825 XSetWMProtocols(dpy,
id, protocols, n);
831 setNetWmWindowTypes();
834 long curr_pid = getpid();
835 XChangeProperty(dpy,
id,
ATOM(
_NET_WM_PID), XA_CARDINAL, 32, PropModeReplace,
836 (
unsigned char *) &curr_pid, 1);
839 data.fstrut_dirty = 1;
842 if (
QTLWExtra *topData = maybeTopData()) {
843 if (!topData->role.isEmpty()) {
844 QByteArray windowRole = topData->role.toUtf8();
845 XChangeProperty(dpy,
id,
853 XA_WINDOW, 32, PropModeReplace,
854 (
unsigned char *)&
X11->wm_client_leader, 1);
858 data.fstrut_dirty = 0;
861 if (initializeWindow && q->internalWinId()) {
865 XChangeWindowAttributes(dpy,
id, CWBitGravity, &wsa);
874 XSelectInput(dpy,
id, stdDesktopEventMask);
875 }
else if (q->internalWinId()) {
876 XSelectInput(dpy,
id, stdWidgetEventMask);
877 #if !defined (QT_NO_TABLET) 879 if (
X11->ptrXSelectExtensionEvent) {
880 for (
int i = 0; i < tablet_list->
size(); ++i) {
882 X11->ptrXSelectExtensionEvent(dpy,
id, reinterpret_cast<XEventClass*>(tablet.
eventList),
891 }
else if (topLevel) {
892 if (initializeWindow) {
896 if (!topData->caption.isEmpty())
897 setWindowTitle_helper(topData->caption);
901 X11->dndEnable(q,
true);
903 if (maybeTopData() && maybeTopData()->opacity != 255)
904 q->setWindowOpacity(maybeTopData()->opacity/255.);
907 }
else if (q->internalWinId()) {
913 if (extra && !extra->mask.isEmpty() && q->internalWinId())
914 XShapeCombineRegion(
X11->display, q->internalWinId(), ShapeBounding, 0, 0,
915 extra->mask.handle(), ShapeSet);
925 if (
QTLWExtra *topData = maybeTopData()) {
927 if (topData->syncUpdateCounter)
928 XSyncDestroyCounter(dpy, topData->syncUpdateCounter);
941 else if (topLevel && (
data.crect.width() == 0 ||
data.crect.height() == 0))
946 XMapWindow(
X11->display, q->internalWinId());
949 surface->flush(q, q->rect(), q->mapTo(surface->window(),
QPoint()));
953 qDebug() <<
"QWidgetPrivate::create_sys END:" << q;
959 if (widget->
inherits(
"QGLWidget")) {
992 for (
int i = 0; i < children.
size(); ++i) {
1001 #ifndef QT_NO_XRENDER 1007 int screen = xinfo.screen();
1008 if (topLevel &&
X11->use_xrender
1009 &&
X11->argbVisuals[screen] && xinfo.depth() != 32)
1033 const QPalette &pal = q->palette();
1038 if (!q->autoFillBackground() || !brush.
isOpaque())
1047 if (!w->d_func()->isBackgroundInherited())
1057 d->aboutToDestroy();
1059 parentWidget()->d_func()->invalidateBuffer(
d->effectiveRectFor(geometry()));
1060 d->deactivateWidgetCleanup();
1064 for (
int i = 0; i < childList.
size(); ++i) {
1065 register QObject *obj = childList.
at(i);
1067 static_cast<QWidget*>(obj)->destroy(destroySubWindows,
1070 if (QWidgetPrivate::mouseGrabber ==
this)
1072 if (QWidgetPrivate::keyboardGrabber ==
this)
1075 X11->deferred_map.removeAll(
this);
1081 qApp->d_func()->closePopup(
this);
1083 #ifndef QT_NO_XRENDER 1086 XRenderFreePicture(
X11->display,
d->picture);
1089 #endif // QT_NO_XRENDER 1096 X11->dndEnable(
this,
false);
1099 X11->dndEnable(
this,
false);
1105 }
QT_CATCH (
const std::bad_alloc &) {
1130 qDebug() <<
"QWidgetPrivate::setParent_sys START" << q <<
"parent:" << parent;
1133 if (parent && parent->windowType() ==
Qt::Desktop) {
1136 xinfo = parent->d_func()->xinfo;
1142 if (q->isVisible() && q->parentWidget() && parent != q->parentWidget())
1143 q->parentWidget()->d_func()->invalidateBuffer(effectiveRectFor(q->geometry()));
1145 #ifndef QT_NO_CURSOR 1155 if (q->isWindow() && wasCreated)
1156 X11->dndEnable(q,
false);
1162 WId old_winid = wasCreated ?
data.winid : 0;
1167 #ifndef QT_NO_XRENDER 1169 XRenderFreePicture(
X11->display, picture);
1176 if (wasCreated && old_winid) {
1177 XUnmapWindow(
X11->display, old_winid);
1178 if (!old_xinfo.
screen() != xinfo.screen())
1179 XReparentWindow(
X11->display, old_winid, RootWindow(
X11->display, xinfo.screen()), 0, 0);
1195 data.window_flags = f;
1199 adjustFlags(
data.window_flags, q);
1204 if (q->isWindow() || (!parent || parent->isVisible()) || explicitlyHidden)
1210 for (
int i = 0; i < chlist.
size(); ++i) {
1216 if (xinfo.screen() != w->d_func()->xinfo.screen()) {
1223 this->children.removeOne(w);
1226 w->d_func()->invalidateBuffer(w->
rect());
1233 XReparentWindow(
X11->display,
1260 updateSystemBackground();
1265 if (XGetWMColormapWindows(
X11->display, old_winid, &cmwret, &count)) {
1267 int cmw_size =
sizeof(
Window)*count;
1269 memcpy((
char *)cmw, (
char *)cmwret, cmw_size);
1270 XFree((
char *)cmwret);
1272 for (i=0; i<count; i++) {
1273 if (cmw[i] == old_winid) {
1274 cmw[i] = q->internalWinId();
1279 if (XGetWMColormapWindows(
X11->display, q->window()->internalWinId(),
1280 &cmwret, &top_count))
1283 memcpy((
char *)merged_cmw, (
char *)cmw, cmw_size);
1284 memcpy((
char *)merged_cmw + cmw_size, (
char *)cmwret,
sizeof(
Window)*top_count);
1286 XFree((
char *)cmwret);
1291 XSetWMColormapWindows(
X11->display, q->window()->internalWinId(), cmw, count);
1304 #if !defined(QT_NO_IM) 1307 invalidateBuffer(q->rect());
1309 qDebug() <<
"QWidgetPrivate::setParent_sys END" << q;
1317 QPoint p = pos + q->data->crect.topLeft();
1319 return (q->isWindow() || !q->parentWidget()) ? p : q->parentWidget()->d_func()->mapToGlobal(p);
1324 XTranslateCoordinates(
X11->display, q->internalWinId(),
1326 p.
x(), p.
y(), &x, &y, &child);
1335 QPoint p = (q->isWindow() || !q->parentWidget()) ? pos : q->parentWidget()->d_func()->mapFromGlobal(pos);
1336 return p - q->data->crect.topLeft();
1340 XTranslateCoordinates(
X11->display,
1343 return mapFromWS(
QPoint(x, y));
1349 return d->mapToGlobal(pos);
1355 return d->mapFromGlobal(pos);
1372 XSetWindowBackground(
X11->display, q->internalWinId(),
1375 XSetWindowBackgroundPixmap(
X11->display, q->internalWinId(),
XNone);
1378 XSetWindowBackground(
X11->display, q->internalWinId(),
1380 else if (isBackgroundInherited())
1381 XSetWindowBackgroundPixmap(
X11->display, q->internalWinId(), ParentRelative);
1384 XSetWindowBackgroundPixmap(
X11->display, q->internalWinId(),
1387 XSetWindowBackground(
X11->display, q->internalWinId(),
1391 #ifndef QT_NO_CURSOR 1396 XFlush(
X11->display);
1403 XFlush(
X11->display);
1407 static XTextProperty*
1410 static XTextProperty tp = { 0, 0, 0, 0 };
1411 static bool free_prop =
true;
1425 tl[0] = mapped.
data();
1427 errCode = XmbTextListToTextProperty(
X11->display, tl, 1, XStdICCTextStyle, &tp);
1428 #if defined(QT_DEBUG) 1430 qDebug(
"qstring_to_xtp result code %d", errCode);
1433 if (!mapper || errCode < 0) {
1437 tp.encoding = XA_STRING;
1439 tp.nitems = qcs.
length();
1459 if (!q->internalWinId())
1465 PropModeReplace, (
unsigned char *)net_wm_name.data(), net_wm_name.size());
1479 QIcon icon = q->windowIcon();
1484 if(availableSizes.
isEmpty()) {
1491 for(
int i = 0; i < availableSizes.
size(); ++i) {
1492 QSize size = availableSizes.
at(i);
1496 int pos = icon_data.
size();
1498 icon_data[pos++] = image.
width();
1499 icon_data[pos++] = image.
height();
1500 if (
sizeof(
long) ==
sizeof(
quint32)) {
1503 for (
int y = 0; y < image.
height(); ++y) {
1505 for (
int x = 0; x < image.
width(); ++x)
1506 icon_data[pos + y*image.
width() + x] = scanLine[x];
1536 if (!q->internalWinId())
1541 PropModeReplace, (
unsigned char *) icon_data.
data(),
1547 XWMHints *h = XGetWMHints(
X11->display, q->internalWinId());
1550 memset(&wm_hints, 0,
sizeof(wm_hints));
1554 if (pixmap_handle) {
1555 h->icon_pixmap = pixmap_handle;
1556 h->flags |= IconPixmapHint;
1559 h->flags &= ~(IconPixmapHint | IconMaskHint);
1562 XSetWMHints(
X11->display, q->internalWinId(), h);
1570 if (!q->internalWinId())
1577 PropModeReplace, (
unsigned char *) icon_name.constData(), icon_name.size());
1584 if (QWidgetPrivate::mouseGrabber && QWidgetPrivate::mouseGrabber !=
this)
1590 XGrabPointer(
X11->display, effectiveWinId(), False,
1591 (
uint)(ButtonPressMask | ButtonReleaseMask |
1592 PointerMotionMask | EnterWindowMask |
1594 GrabModeAsync, GrabModeAsync,
1599 status == GrabNotViewable ?
"\"GrabNotViewable\"" :
1600 status == AlreadyGrabbed ?
"\"AlreadyGrabbed\"" :
1601 status == GrabFrozen ?
"\"GrabFrozen\"" :
1602 status == GrabInvalidTime ?
"\"GrabInvalidTime\"" :
1604 qWarning(
"QWidget::grabMouse: Failed with %s", s);
1607 QWidgetPrivate::mouseGrabber =
this;
1612 #ifndef QT_NO_CURSOR 1616 if (QWidgetPrivate::mouseGrabber && QWidgetPrivate::mouseGrabber !=
this)
1622 XGrabPointer(
X11->display, effectiveWinId(), False,
1623 (
uint)(ButtonPressMask | ButtonReleaseMask |
1624 PointerMotionMask | EnterWindowMask | LeaveWindowMask),
1625 GrabModeAsync, GrabModeAsync,
1630 status == GrabNotViewable ?
"\"GrabNotViewable\"" :
1631 status == AlreadyGrabbed ?
"\"AlreadyGrabbed\"" :
1632 status == GrabFrozen ?
"\"GrabFrozen\"" :
1633 status == GrabInvalidTime ?
"\"GrabInvalidTime\"" :
1635 qWarning(
"QWidget::grabMouse: Failed with %s", s);
1638 QWidgetPrivate::mouseGrabber =
this;
1646 if (!
qt_nograb() && QWidgetPrivate::mouseGrabber ==
this) {
1647 XUngrabPointer(
X11->display,
X11->time);
1648 XFlush(
X11->display);
1649 QWidgetPrivate::mouseGrabber = 0;
1657 if (QWidgetPrivate::keyboardGrabber && QWidgetPrivate::keyboardGrabber !=
this)
1659 XGrabKeyboard(
X11->display, effectiveWinId(), False, GrabModeAsync, GrabModeAsync,
1661 QWidgetPrivate::keyboardGrabber =
this;
1668 if (!
qt_nograb() && QWidgetPrivate::keyboardGrabber ==
this) {
1669 XUngrabKeyboard(
X11->display,
X11->time);
1670 QWidgetPrivate::keyboardGrabber = 0;
1689 if (tlw->
isVisible() && !tlw->d_func()->topData()->embedded && !
X11->deferred_map.contains(tlw)) {
1690 if (
X11->userTime == 0)
1691 X11->userTime =
X11->time;
1697 e.xclient.type = ClientMessage;
1699 e.xclient.display =
X11->display;
1701 e.xclient.format = 32;
1702 e.xclient.data.l[0] = 1;
1703 e.xclient.data.l[1] =
X11->userTime;
1705 e.xclient.data.l[2] = aw->internalWinId();
1707 e.xclient.data.l[2] =
XNone;
1708 e.xclient.data.l[3] = 0;
1709 e.xclient.data.l[4] = 0;
1711 false, SubstructureNotifyMask | SubstructureRedirectMask, &e);
1722 bool needShow =
false;
1723 Qt::WindowStates
oldstate = windowState();
1724 if (oldstate == newstate)
1742 if (newstate & Qt::WindowMaximized) {
1744 const QRect normalGeometry = geometry();
1747 data->fstrut_dirty =
true;
1750 const QRect fs =
d->frameStrut();
1751 setGeometry(maxRect.
x() + fs.
left(),
1752 maxRect.
y() + fs.
top(),
1769 if (newstate & Qt::WindowFullScreen) {
1776 needShow = isVisible();
1778 if (newstate & Qt::WindowFullScreen) {
1779 data->fstrut_dirty =
true;
1780 const QRect normalGeometry = geometry();
1781 const QPoint fullScreenOffset =
d->frameStrut().topLeft();
1786 setGeometry(
qApp->desktop()->screenGeometry(
this));
1796 if (newstate & Qt::WindowMaximized) {
1798 data->fstrut_dirty =
true;
1801 const QRect fs =
d->frameStrut();
1802 setGeometry(maxRect.
x() + fs.
left(),
1803 maxRect.
y() + fs.
top(),
1822 if (newstate & Qt::WindowMinimized) {
1824 e.xclient.type = ClientMessage;
1826 e.xclient.display =
X11->display;
1827 e.xclient.window =
data->winid;
1828 e.xclient.format = 32;
1829 e.xclient.data.l[0] = IconicState;
1830 e.xclient.data.l[1] = 0;
1831 e.xclient.data.l[2] = 0;
1832 e.xclient.data.l[3] = 0;
1833 e.xclient.data.l[4] = 0;
1834 XSendEvent(
X11->display,
1835 RootWindow(
X11->display,
d->xinfo.screen()),
1836 False, (SubstructureNotifyMask|SubstructureRedirectMask), &e);
1839 XMapWindow(
X11->display, effectiveWinId());
1847 data->window_state = newstate;
1873 invalidateBuffer(q->rect());
1875 if (
QTLWExtra *tlwExtra = maybeTopData())
1876 tlwExtra->waitingForMapNotify = 0;
1880 if (q->isWindow()) {
1881 XWMHints *h = XGetWMHints(
X11->display, q->internalWinId());
1883 bool got_hints = h != 0;
1885 memset(&wm_hints, 0,
sizeof(wm_hints));
1888 h->initial_state = q->isMinimized() ? IconicState : NormalState;
1889 h->flags |= StateHint;
1890 XSetWMHints(
X11->display, q->internalWinId(), h);
1903 if (qobject_cast<QMenu *>(q)) {
1904 p =
static_cast<QMenuPrivate*
>(
this)->causedPopup.widget;
1910 p =
qApp->activeWindow();
1917 XSetTransientForHint(
X11->display, q->internalWinId(), p->
internalWinId());
1920 XSetTransientForHint(
X11->display, q->internalWinId(),
X11->wm_client_leader);
1928 switch (
data.window_modality) {
1943 if (q->minimumSize() == q->maximumSize()) {
1981 Qt::WindowFlags
flags = q->windowFlags();
1984 qWarning() <<
"QWidget: Incompatible window flags: the window can't be on top and on bottom at the same time";
1993 if (q->isFullScreen()) {
1997 if (q->isMaximized()) {
2008 if (!netWmState.isEmpty()) {
2009 XChangeProperty(
X11->display, q->internalWinId(),
2011 (
unsigned char *) netWmState.data(), netWmState.size());
2017 Time userTime =
X11->userTime;
2018 bool setUserTime =
false;
2022 }
else if (userTime != CurrentTime) {
2029 if (!topData()->syncUpdateCounter) {
2031 XSyncIntToValue(&value, 0);
2032 topData()->syncUpdateCounter = XSyncCreateCounter(
X11->display, value);
2034 XChangeProperty(
X11->display, q->internalWinId(),
2037 32, PropModeReplace,
2038 (
uchar *) &topData()->syncUpdateCounter, 1);
2040 topData()->newCounterValueHi = 0;
2041 topData()->newCounterValueLo = 0;
2045 if (!topData()->embedded
2046 && (topData()->validWMState || topData()->waitingForMapNotify)
2047 && !q->isMinimized()) {
2048 X11->deferred_map.append(q);
2052 if (q->isMaximized() && !q->isFullScreen()
2055 XMapWindow(
X11->display, q->internalWinId());
2056 data.fstrut_dirty =
true;
2064 const QRect fs = frameStrut();
2066 q->setGeometry(maxRect.
x() + fs.
left(),
2067 maxRect.
y() + fs.
top(),
2080 XMapWindow(
X11->display, q->internalWinId());
2087 invalidateBuffer(q->rect());
2093 topData()->waitingForMapNotify = 1;
2096 && (!q->autoFillBackground()
2098 if (q->internalWinId()) {
2099 XSetWindowBackgroundPixmap(
X11->display, q->internalWinId(),
XNone);
2100 XMapWindow(
X11->display, q->internalWinId());
2101 updateSystemBackground();
2106 if (q->internalWinId())
2107 XMapWindow(
X11->display, q->internalWinId());
2110 if (
X11->startupId && q->isWindow()) {
2113 sendStartupMessage(message.
constData());
2134 xevent.xclient.type = ClientMessage;
2136 xevent.xclient.display =
X11->display;
2137 xevent.xclient.window = q->internalWinId();
2138 xevent.xclient.format = 8;
2140 Window rootWindow = RootWindow(
X11->display, DefaultScreen(
X11->display));
2142 uint length = strlen(message) + 1;
2147 for (
uint i = 0; i < 20 && i + sent <= length; i++)
2148 xevent.xclient.data.b[i] = message[i + sent++];
2150 XSendEvent(
X11->display, rootWindow,
false, PropertyChangeMask, &xevent);
2151 }
while (sent <= length);
2159 if (!q->isWindow()) {
2160 if (q->internalWinId())
2202 switch (q->windowType()) {
2239 PropModeReplace, (
unsigned char *) windowTypes.
constData(),
2240 windowTypes.
count());
2258 deactivateWidgetCleanup();
2259 if (q->isWindow()) {
2260 X11->deferred_map.removeAll(q);
2261 if (q->internalWinId())
2262 XWithdrawWindow(
X11->display, q->internalWinId(), xinfo.screen());
2263 XFlush(
X11->display);
2265 invalidateBuffer(q->rect());
2266 if (q->internalWinId())
2267 XUnmapWindow(
X11->display, q->internalWinId());
2282 if (q->internalWinId())
2283 XRaiseWindow(
X11->display, q->internalWinId());
2290 if (q->internalWinId())
2291 XLowerWindow(
X11->display, q->internalWinId());
2293 invalidateBuffer(q->rect());
2303 stack[1] = q->internalWinId();
2304 XRestackWindows(
X11->display, stack, 2);
2307 invalidateBuffer(q->rect());
2315 memset(&s, 0,
sizeof(s));
2320 s.width = g.
width();
2324 s.flags |= PMinSize;
2330 s.flags |= PMaxSize;
2337 s.flags |= PResizeInc | PBaseSize;
2346 s.flags |= USPosition;
2347 s.flags |= PPosition;
2354 s.flags |= PWinGravity;
2358 s.win_gravity = StaticGravity;
2385 void QWidgetPrivate::setWSGeometry(
bool dontShow,
const QRect &)
2397 Display *dpy = xinfo.display();
2409 if (!parentWRect.
contains(xrect)) {
2410 xrect &= parentWRect;
2429 if (
data.wrect.contains(vrect)) {
2433 XMoveWindow(dpy,
data.winid, xrect.
x(), xrect.
y());
2450 bool outsideRange = !xrect.
isValid();
2451 bool mapWindow =
false;
2456 XUnmapWindow(dpy,
data.winid);
2458 }
else if (!q->isHidden()) {
2472 for (
int i = 0; i < children.size(); ++i) {
2473 QObject *
object = children.at(i);
2477 w->d_func()->setWSGeometry(jump);
2486 XSetWindowBackgroundPixmap(dpy,
data.winid,
XNone);
2489 XMoveResizeWindow(dpy,
data.winid, xrect.
x(), xrect.
y(), xrect.
width(), xrect.
height());
2494 for (
int i = 0; i < children.size(); ++i) {
2495 QObject *
object = children.at(i);
2508 if (jump &&
data.winid)
2509 XClearArea(dpy,
data.winid, 0, 0, wrect.
width(), wrect.
height(), True);
2511 if (mapWindow && !dontShow) {
2514 XMapWindow(dpy,
data.winid);
2526 if (q->isWindow()) {
2533 topData->normalGeometry =
QRect(0,0,-1,-1);
2537 data.window_state = s;
2540 w =
qMin(w,extra->maxw);
2541 h =
qMin(h,extra->maxh);
2542 w =
qMax(w,extra->minw);
2543 h =
qMax(h,extra->minh);
2546 QSize oldSize(q->size());
2548 QRect r(x, y, w, h);
2552 if (!q->isWindow() && oldGeom == r)
2556 bool isResize = q->
size() != oldSize;
2558 if (q->isWindow()) {
2559 if (w == 0 || h == 0) {
2568 XMoveResizeWindow(dpy,
data.winid, x, y, w, h);
2569 topData()->posFromMove =
false;
2574 if (!q->isVisible())
2581 XMoveResizeWindow(dpy,
data.winid, x, y, w, h);
2582 }
else if (q->isVisible()
2583 && topData()->validWMState
2586 e.xclient.type = ClientMessage;
2588 e.xclient.display =
X11->display;
2589 e.xclient.window = q->internalWinId();
2590 e.xclient.format = 32;
2591 e.xclient.data.l[0] = StaticGravity | 1<<8 | 1<<9 | 1<<10 | 1<<11 | 1<<12;
2592 e.xclient.data.l[1] = x;
2593 e.xclient.data.l[2] = y;
2594 e.xclient.data.l[3] = w;
2595 e.xclient.data.l[4] = h;
2596 XSendEvent(
X11->display, RootWindow(
X11->display, q->x11Info().screen()),
2597 false, (SubstructureNotifyMask | SubstructureRedirectMask), &e);
2598 }
else if (
data.winid) {
2600 XMoveResizeWindow(dpy,
data.winid, q->pos().x(), q->pos().y(), w, h);
2602 }
else if (isResize &&
data.winid) {
2604 && topData()->validWMState
2614 topData()->posFromMove =
false;
2616 XResizeWindow(dpy,
data.winid, w, h);
2623 QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
2624 const bool inTopLevelResize = tlwExtra ? tlwExtra->
inTopLevelResize :
false;
2625 const bool disableInTopLevelResize = inTopLevelResize && q->internalWinId();
2626 if (disableInTopLevelResize) {
2632 if (!isResize && (!inTopLevelResize || disableInTopLevelResize) && q->isVisible()) {
2633 moveRect(
QRect(oldPos, oldSize), x - oldPos.
x(), y - oldPos.y());
2638 if (isResize && (!inTopLevelResize || disableInTopLevelResize) && q->isVisible())
2639 invalidateBuffer_resizeHelper(oldPos, oldSize);
2641 if (disableInTopLevelResize)
2645 if (q->isVisible()) {
2646 if (isMove && q->pos() != oldPos) {
2658 static bool slowResize =
qgetenv(
"QT_SLOW_TOPLEVEL_RESIZE").
toInt();
2663 const bool setTopLevelResize = !slowResize && q->isWindow() && extra && extra->topextra
2664 && !extra->topextra->inTopLevelResize
2665 && (!extra->topextra->backingStore
2666 || !extra->topextra->backingStore->hasStaticContents());
2667 if (setTopLevelResize)
2668 extra->topextra->inTopLevelResize =
true;
2671 if (setTopLevelResize)
2672 extra->topextra->inTopLevelResize =
false;
2675 if (isMove && q->pos() != oldPos)
2686 qDebug() <<
"QWidgetPrivate::setConstraints_sys START" << q;
2692 if (q->minimumSize() == q->maximumSize())
2700 qDebug() <<
"QWidgetPrivate::setConstraints_sys END" << q;
2708 scrollChildren(dx, dy);
2709 if (!paintOnScreen()) {
2710 scrollRect(q->rect(), dx, dy);
2712 scroll_sys(dx, dy,
QRect());
2720 if (!paintOnScreen()) {
2721 scrollRect(r, dx, dy);
2724 bool valid_rect = r.
isValid();
2725 bool just_update =
qAbs(dx) > q->width() ||
qAbs(dy) > q->height();
2726 QRect sr = valid_rect ? r : clipRect();
2729 else if (!valid_rect)
2730 dirty.translate(dx, dy);
2732 int x1, y1, x2, y2, w = sr.
width(), h = sr.
height();
2752 if (dx == 0 && dy == 0)
2757 if (w > 0 && h > 0 && !just_update && q->internalWinId()) {
2758 GC gc = XCreateGC(dpy, q->internalWinId(), 0, 0);
2759 XSetGraphicsExposures(dpy, gc, True);
2760 XCopyArea(dpy, q->internalWinId(), q->internalWinId(), gc, x1, y1, w, h, x2, y2);
2764 if (!valid_rect && !children.isEmpty()) {
2766 for (
int i = 0; i < children.size(); ++i) {
2767 register QObject *
object = children.at(i);
2783 int x = x2 == sr.
x() ? sr.
x()+w : sr.
x();
2784 if (repaint_immediately)
2786 else if (q->internalWinId())
2790 int y = y2 == sr.
y() ? sr.
y()+h : sr.
y();
2791 if (repaint_immediately)
2793 else if (q->internalWinId())
2794 XClearArea(dpy,
data.winid, sr.
x(), y, sr.
width(),
qAbs(dy), True);
2804 if (m == PdmWidth) {
2805 val =
data->crect.width();
2806 }
else if (m == PdmHeight) {
2807 val =
data->crect.height();
2810 int scr =
d->xinfo.screen();
2813 case PdmPhysicalDpiX:
2814 if (
d->extra &&
d->extra->customDpiX)
2815 val =
d->extra->customDpiX;
2817 val =
static_cast<QWidget *
>(
d->parent)->metric(m);
2822 case PdmPhysicalDpiY:
2823 if (
d->extra &&
d->extra->customDpiY)
2824 val =
d->extra->customDpiY;
2826 val =
static_cast<QWidget *
>(
d->parent)->metric(m);
2831 val = (DisplayWidthMM(dpy,scr)*
data->crect.width())/
2832 DisplayWidth(dpy,scr);
2835 val = (DisplayHeightMM(dpy,scr)*
data->crect.height())/
2836 DisplayHeight(dpy,scr);
2839 val =
d->xinfo.cells();
2842 val =
d->xinfo.depth();
2846 qWarning(
"QWidget::metric: Invalid metric command");
2854 extra->compress_events =
true;
2855 extra->xDndProxy = 0;
2864 extra->topextra->spont_unmapped = 0;
2865 extra->topextra->dnd = 0;
2866 extra->topextra->validWMState = 0;
2867 extra->topextra->waitingForMapNotify = 0;
2868 extra->topextra->parentWinId = 0;
2869 extra->topextra->userTimeWindow = 0;
2871 extra->topextra->syncUpdateCounter = 0;
2872 extra->topextra->syncRequestTimestamp = 0;
2873 extra->topextra->newCounterValueHi = 0;
2874 extra->topextra->newCounterValueLo = 0;
2883 if (extra && extra->topextra && extra->topextra->syncUpdateCounter) {
2884 XSyncDestroyCounter(
X11->display, extra->topextra->syncUpdateCounter);
2885 extra->topextra->syncUpdateCounter = 0;
2898 if (!q->internalWinId())
2902 XShapeCombineMask(
X11->display, q->internalWinId(), ShapeBounding, 0, 0,
2905 XShapeCombineRegion(
X11->display, q->internalWinId(), ShapeBounding, 0, 0,
2906 region.
handle(), ShapeSet);
2928 if (!q->isWindow() && !q->internalWinId()) {
2929 data.fstrut_dirty =
false;
2934 Window l = q->effectiveWinId(), w =
l, p, r;
2938 unsigned char *data_ret;
2939 unsigned long l_unused;
2941 while (XQueryTree(
X11->display, w, &r, &p, &c, &nc)) {
2946 qWarning(
"QWidget::updateFrameStrut: No parent");
2954 (XGetWindowProperty(
X11->display, p,
2956 &type_ret, &i_unused, &l_unused, &l_unused,
2958 type_ret == XA_CARDINAL)) {
2965 while (
X11->net_virtual_root_list[i] != 0) {
2966 if (
X11->net_virtual_root_list[i++] == p)
2977 XWindowAttributes wattr;
2978 if (XTranslateCoordinates(
X11->display, l, w,
2979 0, 0, &transx, &transy, &p) &&
2980 XGetWindowAttributes(
X11->display, w, &wattr)) {
2983 wattr.width -
data.crect.width() - transx,
2984 wattr.height -
data.crect.height() - transy);
2995 wattr.border_width);
2998 data.fstrut_dirty =
false;
3006 32, PropModeReplace, (
uchar*)&value, 1);
3018 if (!q->internalWinId())
3020 QByteArray windowRole = topData()->role.toUtf8();
3021 XChangeProperty(
X11->display, q->internalWinId(),
3030 if (qt_widget_paintengine()->isActive()) {
3031 if (
d->extraPaintEngine)
3032 return d->extraPaintEngine;
3035 return d->extraPaintEngine;
3037 return qt_widget_paintengine();
3047 #ifndef QT_NO_XRENDER 3054 #endif // QT_NO_XRENDER 3057 #ifndef QT_NO_XRENDER 3065 color.alpha = (A | A << 8);
3066 color.red = (R | R << 8) * color.alpha / 0x10000;
3067 color.green = (G | G << 8) * color.alpha / 0x10000;
3068 color.blue = (B | B << 8) * color.alpha / 0x10000;
3073 if (!
X11->use_xrender)
3076 XRenderColor color = preMultiply(c);
3077 for (
int i = 0; i <
X11->solid_fill_count; ++i) {
3078 if (
X11->solid_fills[i].screen == screen
3079 &&
X11->solid_fills[i].color.alpha == color.alpha
3080 &&
X11->solid_fills[i].color.red == color.red
3081 &&
X11->solid_fills[i].color.green == color.green
3082 &&
X11->solid_fills[i].color.blue == color.blue)
3083 return X11->solid_fills[i].picture;
3086 int i =
qrand() % 16;
3088 if (
X11->solid_fills[i].screen != screen &&
X11->solid_fills[i].picture) {
3089 XRenderFreePicture (
X11->display,
X11->solid_fills[i].picture);
3090 X11->solid_fills[i].picture = 0;
3093 if (!
X11->solid_fills[i].picture) {
3094 Pixmap pixmap = XCreatePixmap (
X11->display, RootWindow (
X11->display, screen), 1, 1, 32);
3095 XRenderPictureAttributes attrs;
3096 attrs.repeat = True;
3097 X11->solid_fills[i].picture = XRenderCreatePicture (
X11->display, pixmap,
3098 XRenderFindStandardFormat(
X11->display, PictStandardARGB32),
3100 XFreePixmap (
X11->display, pixmap);
3103 X11->solid_fills[i].color = color;
3104 X11->solid_fills[i].screen = screen;
3105 XRenderFillRectangle (
X11->display, PictOpSrc,
X11->solid_fills[i].picture, &color, 0, 0, 1, 1);
3106 return X11->solid_fills[i].picture;
3117 const XWindowAttributes &
a = *(att.
att);
3121 for (i = 0; i < ScreenCount(
X11->display); i++) {
3122 if (RootWindow(
X11->display, i) == a.root) {
3128 xd->
depth = a.depth;
3131 xd->
defaultVisual = (XVisualIDFromVisual((Visual *) a.visual) ==
3141 if (!q->isWindow() || !q->internalWinId())
3144 XWMHints *h = XGetWMHints(
X11->display, q->internalWinId());
3147 memset(&wm_hints, 0,
sizeof(wm_hints));
3150 h->flags |= InputHint;
3153 XSetWMHints(
X11->display, q->internalWinId(), h);
static QTextCodec * codecForLocale()
Returns a pointer to the codec most suitable for this locale.
T qobject_cast(QObject *object)
The QColor class provides colors based on RGB, HSV or CMYK values.
HCURSOR_or_HANDLE handle() const
Returns a platform-specific cursor handle.
static void jump(QtMsgType t, const char *m)
QImage toImage() const
Converts the pixmap to a QImage.
static QColormap instance(int screen=-1)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
void push_back(const T &t)
This function is provided for STL compatibility.
QList< QSize > availableSizes(Mode mode=Normal, State state=Off) const
Returns a list of available icon sizes for the specified mode and state.
The QCursor class provides a mouse cursor with an arbitrary shape.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
static const char * appClass()
Returns the X11 application class.
QPointer< QWidget > widget
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
char * data()
Returns a pointer to the data stored in the byte array.
static int appScreen()
Returns the number of the screen where the application is being displayed.
void qPRCleanup(QWidget *widget)
int count(const T &t) const
Returns the number of occurrences of value in the vector.
QByteArray & append(char c)
Appends the character ch to this byte array.
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
QPixmap qt_toX11Pixmap(const QImage &image)
static QAbstractEventDispatcher * instance(QThread *thread=0)
Returns a pointer to the event dispatcher object for the specified thread.
QExplicitlySharedDataPointer< QPixmapData > data
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
static bool appDefaultVisual(int screen=-1)
Returns true if the application has a default visual on the given screen; otherwise returns false...
The QByteArray class provides an array of bytes.
static Qt::HANDLE appRootWindow(int screen=-1)
Returns a handle for the applications root window on the given screen.
static QWidget * activeWindow()
Returns the application top-level window that has the keyboard input focus, or 0 if no application wi...
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
int left() const
Returns the x-coordinate of the rectangle's left edge.
int byteCount() const
Returns the number of bytes occupied by the image data.
int width() const
Returns the width of the rectangle.
Qt::HANDLE handle() const
Returns the pixmap's handle to the device context.
long ASN1_INTEGER_get ASN1_INTEGER * a
const XWindowAttributes * att
ushort red
Returns the red color component of this color.
int height() const
Returns the height of the rectangle.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
Q_CORE_EXPORT int qrand()
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QVector class is a template class that provides a dynamic array.
The QObject class is the base class of all Qt objects.
The QElapsedTimer class provides a fast way to calculate elapsed times.
qint64 elapsed() const
Returns the number of milliseconds since this QElapsedTimer was last started.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
static bool isCompositingManagerRunning()
Returns true if there is a compositing manager running.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void resize(int size)
Sets the size of the vector to size.
QFuture< T > mapped(const Sequence &sequence, MapFunction function)
Q_CORE_EXPORT void qDebug(const char *,...)
static QWidget * widgetAt(const QPoint &p)
Returns the widget at global screen position point, or 0 if there is no Qt widget there...
QX11InfoData * getX11Data(bool def=false) const
void setParent_helper(QObject *)
The QBitmap class provides monochrome (1-bit depth) pixmaps.
T * data() const
Returns a pointer to the shared data object.
static QCursor * overrideCursor()
Strips out vertical alignment flags and transforms an alignment align of Qt::AlignLeft into Qt::Align...
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QMoveEvent class contains event parameters for move events.
QByteArray fromUnicode(const QString &uc) const
Converts str from Unicode to the encoding of this codec, and returns the result in a QByteArray...
Q_GUI_EXPORT EGLDisplay display()
virtual void widgetDestroyed(QWidget *w)
This virtual function is called when the specified widget is destroyed.
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
static int appDpiX(int screen=-1)
Returns the horizontal resolution of the given screen in terms of the number of dots per inch...
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
bool isNull() const
Returns true if both the x and y coordinates are set to 0, otherwise returns false.
void append(const T &t)
Inserts value at the end of the vector.
The QResizeEvent class contains event parameters for resize events.
Q_CORE_EXPORT void qWarning(const char *,...)
void setSize(const QSize &s)
Sets the size of the rectangle to the given size.
The QImage class provides a hardware-independent image representation that allows direct access to th...
static bool appDefaultColormap(int screen=-1)
Returns true if the application has a default color map on the given screen; otherwise returns false...
static const char * data(const QByteArray &arr)
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
Picture getSolidFill(int screen, const QColor &c)
static void sendPostedEvents()
The QRegion class specifies a clip region for a painter.
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Qt::BrushStyle style() const
Returns the brush style.
The State element defines configurations of objects and properties.
void setCoords(int x1, int y1, int x2, int y2)
Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its botto...
void * visual() const
Returns the current visual.
QPixmap texture() const
Returns the custom brush pattern, or a null pixmap if no custom brush pattern has been set...
static Qt::HANDLE appColormap(int screen=-1)
Returns a handle for the application's color map on the given screen.
bool isOpaque() const
Returns true if the brush is fully opaque otherwise false.
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
The QWindowSurface class provides the drawing area for top-level windows.
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
static QWidget * parentWidget(const QWidget *w)
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
int length() const
Same as size().
const char * constData() const
Returns a pointer to the data stored in the byte array.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
int top() const
Returns the y-coordinate of the rectangle's top edge.
int width() const
Returns the width of the image.
The QX11Info class provides information about the X display configuration.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
ushort blue
Returns the blue color component of this color.
The QWindowStateChangeEvent class provides the window state before a window state change...
int right() const
Returns the x-coordinate of the rectangle's right edge.
static QInputContext * inputContext
ushort alpha
Returns the alpha color component of this color.
int y() const
Returns the y-coordinate of the rectangle's top edge.
static void * appVisual(int screen=-1)
Returns the current visual used by the application on the given screen.
int x() const
Returns the x-coordinate of the rectangle's left edge.
int toInt(bool *ok=0, int base=10) const
Returns the byte array converted to an int using base base, which is 10 by default and must be betwee...
QObject * parent() const
Returns a pointer to the parent object.
The QPoint class defines a point in the plane using integer precision.
long unsigned int eventList[TOTAL_XINPUT_EVENTS]
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
int size() const
Returns the number of items in the list.
QByteArray toAscii() const Q_REQUIRED_RESULT
Returns an 8-bit representation of the string as a QByteArray.
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
const QObjectList & children() const
Returns a list of child objects.
int height() const
Returns the height of the image.
int size() const
Returns the number of bytes in this byte array.
int y() const
Returns the y coordinate of this point.
The QPixmap class is an off-screen image representation that can be used as a paint device...
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QSize class defines the size of a two-dimensional object using integer point precision.
T * data()
Returns a pointer to the data stored in the vector.
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
const T * constData() const
Returns a const pointer to the data stored in the vector.
void setX11Data(const QX11InfoData *)
Makes a shallow copy of the X11-specific data d and assigns it to this class.
int x() const
Returns the x coordinate of this point.
The QInputContext class abstracts the input method dependent data and composing state.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
The QTextCodec class provides conversions between text encodings.
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
virtual void setFocusWidget(QWidget *w)
Sets the widget that has an input focus for this input context.
The QEvent class is the base class of all event classes.
static bool isRightToLeft()
Returns true if the application's layout direction is Qt::RightToLeft; otherwise returns false...
static void leaveModal(QWidget *)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
ushort green
Returns the green color component of this color.
XRenderColor preMultiply(const QColor &c)
int size() const
Returns the number of items in the vector.
void start()
Starts this timer.
QTabletDeviceDataList * qt_tablet_devices()
static Display * display()
Returns the default display for the application.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
static void flush()
Flushes the platform specific event queues.
Handle handle() const
Returns a platform-specific region handle.
int screen() const
Returns the number of the screen currently in use.
The QList class is a template class that provides lists.
static Qt::KeyboardModifiers oldstate
void qPRCreate(const QWidget *widget, Window oldwin)
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.
static int appDpiY(int screen=-1)
Returns the vertical resolution of the given screen in terms of the number of dots per inch...