Use own Xcb::sync() method in main.cpp
QApplication::syncX() is a no-op in Qt 5 so we need a replacement.
This commit is contained in:
parent
8da23f76d3
commit
d164e16b56
2 changed files with 16 additions and 2 deletions
4
main.cpp
4
main.cpp
|
@ -258,7 +258,7 @@ Application::Application()
|
|||
|
||||
// Check whether another windowmanager is running
|
||||
XSelectInput(display(), rootWindow(), SubstructureRedirectMask);
|
||||
syncX(); // Trigger error now
|
||||
Xcb::sync(); // Trigger error now
|
||||
|
||||
atoms = new Atoms;
|
||||
|
||||
|
@ -271,7 +271,7 @@ Application::Application()
|
|||
// create workspace.
|
||||
(void) new Workspace(isSessionRestored());
|
||||
|
||||
syncX(); // Trigger possible errors, there's still a chance to abort
|
||||
Xcb::sync(); // Trigger possible errors, there's still a chance to abort
|
||||
|
||||
initting = false; // Startup done, we are up and running now.
|
||||
|
||||
|
|
14
xcbutils.h
14
xcbutils.h
|
@ -23,6 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <kwinglobals.h>
|
||||
#include "utils.h"
|
||||
|
||||
#include <KDE/KDebug>
|
||||
|
||||
#include <QRect>
|
||||
#include <QRegion>
|
||||
#include <QVector>
|
||||
|
@ -685,6 +687,18 @@ static inline void setInputFocus(xcb_window_t window, uint8_t revertTo, xcb_time
|
|||
xcb_set_input_focus(connection(), revertTo, window, time);
|
||||
}
|
||||
|
||||
static inline void sync()
|
||||
{
|
||||
auto *c = connection();
|
||||
const auto cookie = xcb_get_input_focus(c);
|
||||
xcb_generic_error_t *error = nullptr;
|
||||
ScopedCPointer<xcb_get_input_focus_reply_t> sync(xcb_get_input_focus_reply(c, cookie, &error));
|
||||
if (error) {
|
||||
kWarning(1212) << "Sync error" << kBacktrace();
|
||||
free(error);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace X11
|
||||
|
||||
} // namespace KWin
|
||||
|
|
Loading…
Reference in a new issue