GTK/GDK/X11 Issue With Window Titles Larger Than Window on Ubuntu 16.04

22 Views Asked by At

I am using GTK 3.20.8 on (admittedly old) Ubuntu 16.04 using X11 as the window manager. When there is a window title larger than the size of the window, the title completely disappears, unless the window is resized to be larger than the length of the title. This can be seen by simply opening gedit for example, or if you want to use a simple GTK program this would do it:

#include <gtk/gtk.h>

int main(int argc, char *argv[]) {

   GtkWidget *button;
   GtkWidget *window;

   gtk_init(&argc,&argv);

   button = gtk_button_new_with_label("LARGE BUTTON");
   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

   gtk_widget_set_size_request(button, 300, 300);

   gtk_window_set_title(GTK_WINDOW(window), "foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar");

   gtk_container_add(GTK_CONTAINER(window), button);

   g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);

   gtk_widget_show_all(window);

   gtk_main();

   return 0;
}

I have another computer using Ubuntu 22.04 with GTK 3.24.33 and when the same program is run instead of the title completely disappearing, it is cut off using ..., which is highly preferred. Even on Ubuntu 18.04 this is corrected.

Is there any way to reproduce this behavior on the older Ubuntu? I am not sure if this behavior is governed by X11, GTK/GDK, or maybe even GNOME Desktop? If it is X11 or GNOME then I imagine I could upgrade those libraries?

I would have asked this question on Ask Ubuntu but Ubuntu 16.04 is EOL and so off topic. Also upgrading the OS to Ubuntu 18.04 or higher is not an option. Any clues would be appreciated. Thanks!

0

There are 0 best solutions below