나는 책벌레로 업그레이드된 다른 데비안 불스아이 시스템에서 잘 돌아가는 GTK4 애플리케이션 GTKConsole을 가지고 있습니다. Wayland나 X 등 다른 컴퓨터에 새 Bookworm을 설치했는데 작동하지 않고 대신 다음 오류가 발생합니다.
Failed to create drawable
[xcb] Unknown sequence number while processing queue
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that
GTKConsole: ../../src/xcb_io.c:278: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed
Aborted
어떻게 되어가나요? GTK 창을 어떻게 표시하나요? 이 코드는 다른 데비안 책벌레 설치에서 실행되는 활성화 신호를 호출합니다:
static void activate (GtkApplication* app, gpointer user_data) {
GtkWidget *lwindow;
GtkWidget *rwindow;
lwindow = gtk_application_window_new(app);
rwindow = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (lwindow), "Left Panel");
gtk_window_set_title (GTK_WINDOW (rwindow), "Right Panel");
GdkDisplay * display; GListModel* monitors;
display = gdk_display_get_default();
monitors = gdk_display_get_monitors(display);
GdkMonitor * monitor = (GdkMonitor *) g_list_model_get_item(monitors, 0);
GdkMonitor * monitor2 = (GdkMonitor *) g_list_model_get_item(monitors, 1); //1 2 for 3 displays, 0 1 for 2
GtkCssProvider * cssProvider = gtk_css_provider_new();
gtk_css_provider_load_from_path(cssProvider, "styling.css");
gtk_style_context_add_provider_for_display(gtk_widget_get_display(lwindow), GTK_STYLE_PROVIDER(cssProvider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
gtk_style_context_add_provider_for_display(gtk_widget_get_display(rwindow), GTK_STYLE_PROVIDER(cssProvider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
make_toggles(lwindow, (unsigned char) 0);
make_toggles(rwindow, (unsigned char) 1);
update_toggles();
if (pthread_create(&thread_id, NULL, updateThread, NULL)) {
log_perror("GTK could not create thread");
exit(-1);
}
gtk_window_fullscreen_on_monitor(GTK_WINDOW(lwindow), monitor2);
gtk_window_fullscreen_on_monitor(GTK_WINDOW(rwindow), monitor);
//gtk_widget_show(lwindow); gtk_widget_show (rwindow); //deprecated as of gtk 4.10
gtk_window_present(GTK_WINDOW(lwindow)); gtk_window_present(GTK_WINDOW(rwindow));
}