Codebase list xapp / a465dd8
xapp-display: Don't use deprecated gtk_widget_modify_bg This was deprecated with the invention of gtk3.0. Instead switch to the modern method of using css style providers and classes. This quiets some build warnings we get. JosephMcc 7 years ago
1 changed file(s) with 9 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
6868 {
6969 GdkRectangle fullscreen;
7070 GtkWidget *window;
71 GdkColor color;
71 GtkStyleContext *context;
72 GtkCssProvider *provider;
7273
7374 gdk_screen_get_monitor_geometry(screen, monitor, &fullscreen);
7475
7980 gtk_window_move (GTK_WINDOW (window), fullscreen.x, fullscreen.y);
8081 gtk_widget_set_visible (window, TRUE);
8182
82 color.red = 0x00C0;
83 color.green = 0x00DE;
84 color.blue = 0x00ED;
85 gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &color);
83 context = gtk_widget_get_style_context (GTK_WIDGET (window));
84 gtk_style_context_add_class (context, "xapp-blanking-window");
85 provider = gtk_css_provider_new ();
86 gtk_css_provider_load_from_data (provider,
87 ".xapp-blanking-window { background-color: rgb(0, 0, 0); }",
88 -1, NULL);
89 gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
8690
8791 return window;
8892 }