Different behaviour under Wayland

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a simple GTK+ application (source attached) which works slightly
differently when run in Wayland or X11.  I'm using fully updated Fedora
25 so GTK+ is version 3.22.6.

Firstly, when run under Wayland the application has a size slightly
greater than its natural size.  That is, I am able to reduce its size
manually.  Under X11 the application appears at its natural size and
can only be made bigger manually.

Secondly, under Wayland there is no menu icon in the titlebar.  Right
clicking where the icon should be invokes the window menu.  Under X11
the menu icon is present in the titlebar and the window menu can be
invoked by a right or left click.

In each case I prefer the behaviour under X11 and would like to have the
same behaviour under Wayland.  Do I need to change my program to do this
or is the problem elsewhere?

Ron
#include <gtk/gtk.h>

int main(int argc, char **argv)
{
    GtkWidget *shell, *mainw, *graph;

	gtk_init(&argc, &argv);

	shell = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_title(GTK_WINDOW(shell), "tester");
	g_signal_connect(G_OBJECT(shell), "destroy",
						G_CALLBACK(gtk_main_quit), NULL);

	mainw = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);

	gtk_container_add(GTK_CONTAINER(shell), GTK_WIDGET(mainw));
	gtk_widget_set_name(GTK_WIDGET(mainw), "MainWindow");
	gtk_widget_show(GTK_WIDGET(mainw));

	graph = gtk_drawing_area_new();

	gtk_widget_set_size_request(GTK_WIDGET(graph), 750, 600);
	gtk_widget_set_name(GTK_WIDGET(graph), "graph");

	gtk_box_pack_start(GTK_BOX(mainw), GTK_WIDGET(graph), TRUE, TRUE, 0);
	gtk_widget_show(GTK_WIDGET(graph)) ;

	gtk_widget_show_all(shell);

	gtk_main();

    return 0;
}
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux