mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Simplify XErrorHandlerRestorer API
This commit is contained in:
@@ -17,6 +17,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "main/main_domain.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
using Platform::internal::XErrorHandlerRestorer;
|
||||
|
||||
namespace Platform {
|
||||
namespace Libs {
|
||||
namespace {
|
||||
@@ -123,8 +125,7 @@ bool setupGtkBase(QLibrary &lib_gtk) {
|
||||
|
||||
// gtk_init will reset the Xlib error handler, and that causes
|
||||
// Qt applications to quit on X errors. Therefore, we need to manually restore it.
|
||||
internal::XErrorHandlerRestorer handlerRestorer;
|
||||
handlerRestorer.save();
|
||||
XErrorHandlerRestorer handlerRestorer;
|
||||
|
||||
DEBUG_LOG(("Library gtk functions loaded!"));
|
||||
gtkTriedToInit = true;
|
||||
@@ -135,8 +136,6 @@ bool setupGtkBase(QLibrary &lib_gtk) {
|
||||
}
|
||||
DEBUG_LOG(("Checked gtk with gtk_init_check!"));
|
||||
|
||||
handlerRestorer.restore();
|
||||
|
||||
// Use our custom log handler.
|
||||
g_log_set_handler("Gtk", G_LOG_LEVEL_MESSAGE, gtkMessageHandler, nullptr);
|
||||
|
||||
|
Reference in New Issue
Block a user