diff options
| author | Simon Tatham <anakin@pobox.com> | 2015-10-03 12:28:15 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2015-10-03 16:07:19 +0100 |
| commit | d6210656b8ee6e182a9f879a4089d7e6f3fdf570 (patch) | |
| tree | 57f8c95757da544520112a4f915645dfeafcc931 | |
| parent | 4e1cc6570180381866735d7e23223f4ac4a68b08 (diff) | |
| download | puzzles-d6210656b8ee6e182a9f879a4089d7e6f3fdf570.zip puzzles-d6210656b8ee6e182a9f879a4089d7e6f3fdf570.tar.gz puzzles-d6210656b8ee6e182a9f879a4089d7e6f3fdf570.tar.bz2 puzzles-d6210656b8ee6e182a9f879a4089d7e6f3fdf570.tar.xz | |
GTK 3 port: stop getting default bg colour from the window style.
GTK3 window styles don't reliably provide one, so we have to fall back
to just making one up.
| -rw-r--r-- | gtk.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -186,10 +186,26 @@ void get_random_seed(void **randseed, int *randseedsize) void frontend_default_colour(frontend *fe, float *output) { +#if !GTK_CHECK_VERSION(3,0,0) + /* + * Use the widget style's default background colour as the + * background for the puzzle drawing area. + */ GdkColor col = gtk_widget_get_style(fe->window)->bg[GTK_STATE_NORMAL]; output[0] = col.red / 65535.0; output[1] = col.green / 65535.0; output[2] = col.blue / 65535.0; +#else + /* + * GTK 3 has decided that there's no such thing as a 'default + * background colour' any more, because widget styles might set + * the background to something more complicated like a background + * image. We don't want to get into overlaying our entire puzzle + * on an arbitrary background image, so we'll just make up a + * reasonable shade of grey. + */ + output[0] = output[1] = output[2] = 0.9F; +#endif } void gtk_status_bar(void *handle, char *text) |