Skip to content

Commit

Permalink
Update to version 1.2 - avoid unnecessary calls to setFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
culler committed Aug 10, 2024
1 parent 030fcf8 commit abc8b78
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 125 deletions.
6 changes: 3 additions & 3 deletions ci/linux/build_linux_tkgl.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
set -e
TKGL_VERSION=1.1
TCL8_VERSION=8.6.13
TCL9_VERSION=9.0b1
TKGL_VERSION=1.2
TCL8_VERSION=8.6.14
TCL9_VERSION=9.0b3
TCL8_URL=https://prdownloads.sourceforge.net/tcl/tcl$TCL8_VERSION-src.tar.gz
TK8_URL=https://prdownloads.sourceforge.net/tcl/tk$TCL8_VERSION-src.tar.gz
TCL9_URL=https://prdownloads.sourceforge.net/tcl/tcl$TCL9_VERSION-src.tar.gz
Expand Down
18 changes: 9 additions & 9 deletions ci/linux/linux_configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for Tkgl 1.1.
# Generated by GNU Autoconf 2.71 for Tkgl 1.2.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
Expand Down Expand Up @@ -608,8 +608,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Tkgl'
PACKAGE_TARNAME='tkgl'
PACKAGE_VERSION='1.1'
PACKAGE_STRING='Tkgl 1.1'
PACKAGE_VERSION='1.2'
PACKAGE_STRING='Tkgl 1.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1347,7 +1347,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Tkgl 1.1 to adapt to many kinds of systems.
\`configure' configures Tkgl 1.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1409,7 +1409,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Tkgl 1.1:";;
short | recursive ) echo "Configuration of Tkgl 1.2:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1513,7 +1513,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Tkgl configure 1.1
Tkgl configure 1.2
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1769,7 +1769,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Tkgl $as_me 1.1, which was
It was created by Tkgl $as_me 1.2, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -9789,7 +9789,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Tkgl $as_me 1.1, which was
This file was extended by Tkgl $as_me 1.2, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -9844,7 +9844,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
Tkgl config.status 1.1
Tkgl config.status 1.2
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Expand Down
10 changes: 5 additions & 5 deletions ci/macOS/build_mac_tkgl.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
set -e
TKGL_VERSION=1.1
TCL8_SOURCE=tcl8.6.13-src.tar.gz
TCL9_SOURCE=tcl9.0b1-src.tar.gz
TK8_SOURCE=tk8.6.13-src.tar.gz
TK9_SOURCE=tk9.0b1-src.tar.gz
TKGL_VERSION=1.2
TCL8_SOURCE=tcl8.6.14-src.tar.gz
TCL9_SOURCE=tcl9.0b3-src.tar.gz
TK8_SOURCE=tk8.6.14-src.tar.gz
TK9_SOURCE=tk9.0b3-src.tar.gz
TCL8_URL=https://prdownloads.sourceforge.net/tcl/$TCL8_SOURCE
TK8_URL=https://prdownloads.sourceforge.net/tcl/$TK8_SOURCE
TCL9_URL=https://prdownloads.sourceforge.net/tcl/$TCL9_SOURCE
Expand Down
18 changes: 9 additions & 9 deletions ci/macOS/mac_configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for Tkgl 1.1.
# Generated by GNU Autoconf 2.71 for Tkgl 1.2.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
Expand Down Expand Up @@ -608,8 +608,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Tkgl'
PACKAGE_TARNAME='tkgl'
PACKAGE_VERSION='1.1'
PACKAGE_STRING='Tkgl 1.1'
PACKAGE_VERSION='1.2'
PACKAGE_STRING='Tkgl 1.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1347,7 +1347,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Tkgl 1.1 to adapt to many kinds of systems.
\`configure' configures Tkgl 1.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1409,7 +1409,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Tkgl 1.1:";;
short | recursive ) echo "Configuration of Tkgl 1.2:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1513,7 +1513,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Tkgl configure 1.1
Tkgl configure 1.2
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1769,7 +1769,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Tkgl $as_me 1.1, which was
It was created by Tkgl $as_me 1.2, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -9789,7 +9789,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Tkgl $as_me 1.1, which was
This file was extended by Tkgl $as_me 1.2, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -9844,7 +9844,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
Tkgl config.status 1.1
Tkgl config.status 1.2
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Expand Down
4 changes: 2 additions & 2 deletions ci/windows/fetch_tcltk.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/bash
set -e
TCL8_VERSION=8.6.13
TCL9_VERSION=9.0b1
TCL8_VERSION=8.6.14
TCL9_VERSION=9.0b3
WGET="/c/msys64/usr/bin/wget -nv"
CMD=/c/msys64/usr/bin/cmd
if [ ! -e tcl$TCL8_VERSION-src.tar.gz ] ; then
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
# so that we create the export library with the dll.
#-----------------------------------------------------------------------

AC_INIT([Tkgl],[1.1])
AC_INIT([Tkgl],[1.2])

#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
Expand Down
30 changes: 19 additions & 11 deletions generic/tkgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,15 +557,15 @@ TkglConfigure(
*
* TkglObjEventProc --
*
* This procedure is invoked by the Tk dispatcher for various events on
* tkgls.
* This procedure is invoked by the Tk dispatcher to process events
* sent to a TkGL widget.
*
* Results:
* None.
*
* Side effects:
* When the window gets deleted, internal structures get cleaned up. When
* it gets exposed, it is redisplayed.
* it gets exposed or the size changes, it is redisplayed.
*
*--------------------------------------------------------------
*/
Expand All @@ -576,6 +576,7 @@ TkglObjEventProc(
XEvent *eventPtr) /* Information about event. */
{
Tkgl *tkglPtr = (Tkgl *)clientData;
int new_width, new_height;

switch(eventPtr->type) {
case Expose:
Expand All @@ -585,13 +586,20 @@ TkglObjEventProc(
}
break;
case ConfigureNotify:
tkglPtr->width = Tk_Width(tkglPtr->tkwin);
tkglPtr->height = Tk_Height(tkglPtr->tkwin);
XResizeWindow(Tk_Display(tkglPtr->tkwin), Tk_WindowId(tkglPtr->tkwin),
tkglPtr->width, tkglPtr->height);
if (!tkglPtr->updatePending) {
Tcl_DoWhenIdle(TkglDisplay, tkglPtr);
tkglPtr->updatePending = 1;
new_width = Tk_Width(tkglPtr->tkwin);
new_height = Tk_Height(tkglPtr->tkwin);
#if 0
fprintf(stderr, "ConfigureNotify: %d x %d -> %d x %d\n",
tkglPtr->width, tkglPtr->height, new_width, new_height);
#endif
if (new_width != tkglPtr->width || new_height != tkglPtr->height) {
tkglPtr->width = new_width;
tkglPtr->height = new_height;
Tk_ResizeWindow(tkglPtr->tkwin, new_width, new_height);
if (!tkglPtr->updatePending) {
Tcl_DoWhenIdle(TkglDisplay, tkglPtr);
tkglPtr->updatePending = 1;
}
}
break;
case DestroyNotify:
Expand Down Expand Up @@ -662,7 +670,7 @@ TkglDeletedProc(
}
if (tkglPtr->updatePending) {
Tcl_CancelIdleCall(TkglDisplay, (void *) tkglPtr);
tkglPtr->updatePending = False;
tkglPtr->updatePending = 0;
}
#ifndef NO_TK_CURSOR
if (tkglPtr->cursor != NULL) {
Expand Down
7 changes: 7 additions & 0 deletions generic/tkgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
#endif
#include "tk.h"

#if TCL_MAJOR_VERION == 9
/* Allow this package to load after Tcl 9.0 is released */
# define Tcl_InitStubs(interp, version, exact) \
(Tcl_InitStubs)(interp, ((exact) ? (version) : "9b0"), \
(exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
TCL_STUB_MAGIC)
#endif
#if TCL_MAJOR_VERSION == 8
#define TCL_INDEX_NONE (-1)
typedef int Tcl_Size;
Expand Down
Loading

0 comments on commit abc8b78

Please sign in to comment.