OSDN Git Service

use loop-local variable in qt_x11_getX11InfoForWindow()
authorIvailo Monev <xakepa10@laimg.moc>
Tue, 14 Jul 2020 00:05:33 +0000 (00:05 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Tue, 14 Jul 2020 00:05:33 +0000 (00:05 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/gui/kernel/qwidget_x11.cpp

index 140f9bb..0ee6f0e 100644 (file)
@@ -425,8 +425,7 @@ void qt_x11_getX11InfoForWindow(QX11Info *xinfo, const void *att)
     const XWindowAttributes *a = static_cast<const XWindowAttributes*>(att);
     // find which screen the window is on...
     xd->screen = QX11Info::appScreen(); // by default, use the default :)
-    int i;
-    for (i = 0; i < ScreenCount(qt_x11Data->display); i++) {
+    for (int i = 0; i < ScreenCount(qt_x11Data->display); i++) {
         if (RootWindow(qt_x11Data->display, i) == a->root) {
             xd->screen = i;
             break;