simon-git: puzzles (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Sat Oct 3 16:16:48 BST 2015


TL;DR:
  8b49194 Don't refresh backing store on a no-op configure event.
  7242dcc Fix packing direction of config boxes.
  238cd9d GTK 3 prep: use accessors instead of direct field access.
  0dc2fd1 GTK 3 prep: use GTK_KEY_* constants.
  71c7bcd GTK 3 prep: use the glib names for base object types.
  2c1b000 GTK 3 prep: use GtkComboBox for drop-down lists.
  0790610 GTK 3 prep: use gtk_radio_menu_item_get_group().
  fd7882f GTK 3 prep: make the server-side backing pixmap optional.
  3d0d54e GTK 3 prep: use GTK instead of GDK window-icon functions.
  64d0a70 GTK 3 prep: use g_timeout_add, not gtk_timeout_add.
  62c6312 GTK 3 port: use GtkGrid as an alternative to GtkTable.
  37232c3 GTK 3 port: provide a 'draw' handler.
  4e1cc65 GTK 3 port: condition out the complicated window resize code.
  d621065 GTK 3 port: stop getting default bg colour from the window style.
  88b38f5 GTK 3 port: use GdkRGBA for the window background colour.
  2fb189c GTK 3 port: be prepared not to use GtkStock.
  90b73eb GTK 3 port: use GtkBox directly, not GtkHBox and GtkVBox.
  1b2e4d5 GTK 3 port: change API functions for widget sizing.
  41cc7c8 GTK 3 port: don't turn off drawing area double buffering.
  9df80d7 GTK 3 port: arrange configure.ac support for GTK 2/3 detection.
  c0308c9 Add '-set colorspace RGB' to some icon convert commands.

Repository:     git://git.tartarus.org/simon/puzzles.git
On the web:     http://tartarus.org/~simon-git/gitweb/?p=puzzles.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2015-10-03 16:16:48

commit 8b491946ef0d7f34b310faf5bf484f5a419887a2
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=8b491946ef0d7f34b310faf5bf484f5a419887a2;hp=f9027226a05b6e2fc49d0256262edc6cc3a8c569
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:27:47 2015 +0100

    Don't refresh backing store on a no-op configure event.
    
    Sometimes, we can get a "configure_area" event telling us that the
    drawing area has changed size to the same size it already was. This
    can happen when we change puzzle presets in a way that doesn't change
    the size, and also sometimes seems to happen as a side effect of
    changing the text in the status line.
    
    In that situation, it's a waste of effort - and can cause visible
    on-screen flicker - to throw away the window's backing image and
    pixmap and regenerate them from scratch. So now we detect a non-resize
    and avoid doing all that.
    
    The only thing we retain unconditionally in configure_area is the
    midend_force_redraw, because that's the place where a puzzle redraw is
    forced when changing presets or loading a new game.

 gtk.c |   30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

commit 7242dcc4effe85a116eb03c1f708719b63d14076
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=7242dcc4effe85a116eb03c1f708719b63d14076;hp=8b491946ef0d7f34b310faf5bf484f5a419887a2
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:27:49 2015 +0100

    Fix packing direction of config boxes.
    
    We were packing the GtkTable into the dialog's content area using
    gtk_box_pack_end, which had the slightly silly effect that resizing
    the config box vertically would keep all the controls aligned to the
    _bottom_ rather than the top.

 gtk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 238cd9dc83a5d4ff7031503dfe4cc247f5de7db9
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=238cd9dc83a5d4ff7031503dfe4cc247f5de7db9;hp=7242dcc4effe85a116eb03c1f708719b63d14076
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:27:51 2015 +0100

    GTK 3 prep: use accessors instead of direct field access.
    
    We now build cleanly with -DGSEAL_ENABLE.

 gtk.c |   78 +++++++++++++++++++++++++++++++++++++----------------------------
 1 file changed, 45 insertions(+), 33 deletions(-)

commit 0dc2fd1ea3f3173964df9171e09b11ef13b7a2e3
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=0dc2fd1ea3f3173964df9171e09b11ef13b7a2e3;hp=238cd9dc83a5d4ff7031503dfe4cc247f5de7db9
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:27:54 2015 +0100

    GTK 3 prep: use GTK_KEY_* constants.

 gtk.c |   48 +++++++++++++++++++++++++++++-------------------
 1 file changed, 29 insertions(+), 19 deletions(-)

commit 71c7bcd9812847f347c4cb393ae2be39806d813c
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=71c7bcd9812847f347c4cb393ae2be39806d813c;hp=0dc2fd1ea3f3173964df9171e09b11ef13b7a2e3
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:27:56 2015 +0100

    GTK 3 prep: use the glib names for base object types.

 gtk.c |  238 ++++++++++++++++++++++++++++++++---------------------------------
 1 file changed, 118 insertions(+), 120 deletions(-)

commit 2c1b00086d80987e830e3de5c9e9b334845951a6
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=2c1b00086d80987e830e3de5c9e9b334845951a6;hp=71c7bcd9812847f347c4cb393ae2be39806d813c
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:27:58 2015 +0100

    GTK 3 prep: use GtkComboBox for drop-down lists.
    
    The previous GtkOptionMenu was long since deprecated.

 gtk.c |   55 ++++++++++++++++++++++++++++---------------------------
 1 file changed, 28 insertions(+), 27 deletions(-)

commit 07906104a2a67221913aebc5f0a5c1e00f3869d9
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=07906104a2a67221913aebc5f0a5c1e00f3869d9;hp=2c1b00086d80987e830e3de5c9e9b334845951a6
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:00 2015 +0100

    GTK 3 prep: use gtk_radio_menu_item_get_group().
    
    Replaces the previous deprecated spelling. We now build cleanly with
    -DGTK_DISABLE_DEPRECATED.

 gtk.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit fd7882fb45829e38d2aa2f44169ae657a229ccec
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=fd7882fb45829e38d2aa2f44169ae657a229ccec;hp=07906104a2a67221913aebc5f0a5c1e00f3869d9
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:02 2015 +0100

    GTK 3 prep: make the server-side backing pixmap optional.
    
    When GDK_DISABLE_DEPRECATED is defined, we now don't have fe->pixmap;
    instead we just maintain our client-side window contents in fe->image,
    and draw from there directly to the window in the expose handler.

 gtk.c |   80 ++++++++++++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 54 insertions(+), 26 deletions(-)

commit 3d0d54e3b407619fa859bf35b115d473afee63db
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=3d0d54e3b407619fa859bf35b115d473afee63db;hp=fd7882fb45829e38d2aa2f44169ae657a229ccec
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:04 2015 +0100

    GTK 3 prep: use GTK instead of GDK window-icon functions.
    
    We now build cleanly with -DGDK_DISABLE_DEPRECATED.

 gtk.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

commit 64d0a70e13533e257e60ea71045a155a057ac61a
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=64d0a70e13533e257e60ea71045a155a057ac61a;hp=3d0d54e3b407619fa859bf35b115d473afee63db
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:06 2015 +0100

    GTK 3 prep: use g_timeout_add, not gtk_timeout_add.

 gtk.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit 62c6312982c297ddb0d5c1633e5db678a0d75678
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=62c6312982c297ddb0d5c1633e5db678a0d75678;hp=64d0a70e13533e257e60ea71045a155a057ac61a
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:09 2015 +0100

    GTK 3 port: use GtkGrid as an alternative to GtkTable.
    
    This also involves setting some "hexpand" properties on the widgets
    contained in the GtkGrid, to achieve effects which GtkTable did by
    setting flags in gtk_table_attach.

 gtk.c |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

commit 37232c3c304d07fcfb8d8f512c0359a7f23fea82
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=37232c3c304d07fcfb8d8f512c0359a7f23fea82;hp=62c6312982c297ddb0d5c1633e5db678a0d75678
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:11 2015 +0100

    GTK 3 port: provide a 'draw' handler.
    
    This is what GTK 3 uses in place of 'expose_event'. Also I've arranged
    here for my internal USE_CAIRO_WITHOUT_PIXMAP setting to be enabled in
    GTK3, as well as in GTK2 with deprecated functions disabled.

 gtk.c |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

commit 4e1cc6570180381866735d7e23223f4ac4a68b08
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=4e1cc6570180381866735d7e23223f4ac4a68b08;hp=37232c3c304d07fcfb8d8f512c0359a7f23fea82
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:13 2015 +0100

    GTK 3 port: condition out the complicated window resize code.
    
    In GTK 2, we had a big pile of horrible code to deal with the fact
    that it's very hard to open a window in such a way as to make it easy
    to resize smaller as well as bigger.
    
    Essentially, we'd open the window with the drawing area's minimum size
    request set to the desired _initial_ window size; then we'd wait until
    GTK had finished creating other window components (menu bar, status
    line) and the window's size allocation had settled down, and finally
    reduce the size request to the real minimum size so that now the
    window was resizable in both directions. This also involved some
    deliberate checking of the Ubuntu Unity GTK extension which steals the
    menu bar and put it elsewhere (see commit 8f8333a35), to avoid us
    waiting forever for a menu bar that wasn't going to show up.
    
    But in GTK3, this has all become actually sensible! All we now have to
    do is to set the window's geometry hints to indicate the drawing area
    itself as the base widget (probably a good plan anyway), and then we
    can set the initial size using gtk_window_set_default_geometry() and
    resize it later using gtk_window_resize_to_geometry(). So now we can
    completely condition out all of the previous horrors, and consider
    them to be legacy GTK2 compatibility code only. Phew.

 gtk.c |   30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

commit d6210656b8ee6e182a9f879a4089d7e6f3fdf570
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=d6210656b8ee6e182a9f879a4089d7e6f3fdf570;hp=4e1cc6570180381866735d7e23223f4ac4a68b08
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:15 2015 +0100

    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.

 gtk.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

commit 88b38f51689fa363f665bd136242938d9107b484
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=88b38f51689fa363f665bd136242938d9107b484;hp=d6210656b8ee6e182a9f879a4089d7e6f3fdf570
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:17 2015 +0100

    GTK 3 port: use GdkRGBA for the window background colour.
    
    Suits our internal API better, anyway, with RGB components being
    floats ranging from 0 to 1.

 gtk.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

commit 2fb189cc36166f3856651e6cae6de828b4be186b
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=2fb189cc36166f3856651e6cae6de828b4be186b;hp=88b38f51689fa363f665bd136242938d9107b484
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:19 2015 +0100

    GTK 3 port: be prepared not to use GtkStock.
    
    GTK 3 has deprecated it in favour of just making you specify fixed
    strings as button labels, which seems like a step backwards to me but
    there we go.

 gtk.c |   33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

commit 90b73ebcb7f0d2c834e00ba0ad74084ad5a5695b
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=90b73ebcb7f0d2c834e00ba0ad74084ad5a5695b;hp=2fb189cc36166f3856651e6cae6de828b4be186b
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:21 2015 +0100

    GTK 3 port: use GtkBox directly, not GtkHBox and GtkVBox.
    
    I've done this by #defining the old names in terms of the new ones,
    because the old ones are still more concise!

 gtk.c |    3 +++
 1 file changed, 3 insertions(+)

commit 1b2e4d525f5e5686afdbec09c7b796ff546c6357
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=1b2e4d525f5e5686afdbec09c7b796ff546c6357;hp=90b73ebcb7f0d2c834e00ba0ad74084ad5a5695b
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:24 2015 +0100

    GTK 3 port: change API functions for widget sizing.
    
    set_usize is deprecated, and get_preferred_size is the GTK 3 thing we
    should use in place of size_request.

 gtk.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

commit 41cc7c868f72e3131a3d45e38994e9d473824bd1
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=41cc7c868f72e3131a3d45e38994e9d473824bd1;hp=1b2e4d525f5e5686afdbec09c7b796ff546c6357
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:26 2015 +0100

    GTK 3 port: don't turn off drawing area double buffering.
    
    I think I did this in GTK2 on the basis that our server-side cache
    pixmap was double-buffering enough for us - any puzzle which erased a
    big area with a background rectangle and then redrew over the top of
    it would do so only on the off-screen pixmap, and the updates would
    only be copied to the visible window after it was all done.
    
    In GTK3, I don't think there's any need - this is all the usual way
    things are done anyway, as far as I can see. So I've turned this call
    back off, at least until I hear of a reason why I need it again.

 gtk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 9df80d7587f9d0060ab74d3cb862e438a9f79291
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=9df80d7587f9d0060ab74d3cb862e438a9f79291;hp=41cc7c868f72e3131a3d45e38994e9d473824bd1
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 12:28:28 2015 +0100

    GTK 3 port: arrange configure.ac support for GTK 2/3 detection.
    
    GTK 3 is the default, falling back to GTK 2 if 3 isn't available; you
    can also say --with-gtk=2 to force GTK 2.

 configure.ac |   35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

commit c0308c9319d40438db668e67fb944e08062148c7
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=c0308c9319d40438db668e67fb944e08062148c7;hp=9df80d7587f9d0060ab74d3cb862e438a9f79291
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Oct 3 13:15:59 2015 +0100

    Add '-set colorspace RGB' to some icon convert commands.
    
    Its absence was breaking the icon build on Ubuntu 14.04, because you
    ask convert to map an image into a specific 16-colour palette, and it
    does so and _then_ nonconsensually maps those colours in turn through
    a colourspace transformation you didn't ask for, causing icon.pl to
    fail an assertion when it finds an RGB value not in the palette.

 icons/Makefile |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)



More information about the tartarus-commits mailing list