mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kdeui: catch X11 errors during selection owner window creation
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
081477c628
commit
7baf0c9d61
1 changed files with 5 additions and 0 deletions
|
@ -103,12 +103,17 @@ bool KSelectionOwner::claim(const bool force)
|
|||
}
|
||||
}
|
||||
kDebug() << "Creating selection owner";
|
||||
KXErrorHandler kx11errorhandler;
|
||||
d->x11window = XCreateSimpleWindow(
|
||||
d->x11display, RootWindow(d->x11display, d->x11screen),
|
||||
0, 0, // x and y
|
||||
1, 1, // width and height
|
||||
0, 0, 0 // border width, border and background pixels
|
||||
);
|
||||
if (kx11errorhandler.error(true)) {
|
||||
kWarning() << KXErrorHandler::errorMessage(kx11errorhandler.errorEvent());
|
||||
return false;
|
||||
}
|
||||
XSetSelectionOwner(d->x11display, d->x11atom, d->x11window, CurrentTime);
|
||||
XFlush(d->x11display);
|
||||
d->timerid = startTimer(KSELECTIONOWNER_CHECKTIME);
|
||||
|
|
Loading…
Add table
Reference in a new issue