1
0
mirror of https://github.com/rricharz/Tek4010.git synced 2026-02-04 15:53:07 +00:00

version 1.2.3, see versions.txt

This commit is contained in:
¨Rene Richarz
2019-04-17 15:13:47 +02:00
parent 038106dd3f
commit a7e87f0036
3 changed files with 22 additions and 3 deletions

19
main.c
View File

@@ -34,7 +34,7 @@
*
*/
#define TIME_INTERVAL 10 // time interval for timer function in msec
#define TIME_INTERVAL 5 // time interval for timer function in msec (after last refresh)
#define GDK_DISABLE_DEPRECATION_WARNINGS
@@ -60,6 +60,8 @@ int windowWidth;
int windowHeight;
static double aspectRatio;
guint global_timeout_ref;
extern int tube_doClearPersistent;
static void do_drawing(cairo_t *, GtkWidget *);
@@ -97,6 +99,8 @@ static void do_drawing(cairo_t *cr, GtkWidget *widget)
static cairo_surface_t *permanent_surface, *temporary_surface;
static int windowHeightOffset = 0;
static int windowWidthOffset = 0;
g_source_remove(global_timeout_ref); // stop timer, in case do_drawing takes too long
if (global_firstcall) {
// force aspect ratio by making black stripes at left and right, or top and bottom
@@ -118,6 +122,12 @@ static void do_drawing(cairo_t *cr, GtkWidget *widget)
CAIRO_CONTENT_COLOR, windowWidth, windowHeight);
temporary_surface = cairo_surface_create_similar(cairo_get_target(cr),
CAIRO_CONTENT_COLOR_ALPHA, windowWidth, windowHeight);
if (argFull) { // hide cursor in full mode
GdkCursor* Cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
GdkWindow* win = gtk_widget_get_window(window);
gdk_window_set_cursor((win), Cursor);
}
}
cairo_t *permanent_cr = cairo_create(permanent_surface);
@@ -138,7 +148,9 @@ static void do_drawing(cairo_t *cr, GtkWidget *widget)
cairo_paint(cr);
cairo_destroy(permanent_cr);
cairo_destroy(temporary_cr);
cairo_destroy(temporary_cr);
global_timeout_ref = g_timeout_add(TIME_INTERVAL, (GSourceFunc) on_timer_event,
(gpointer) window);
}
static void on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
@@ -274,7 +286,8 @@ int main (int argc, char *argv[])
// Add timer event
// Register the timer and set time in mS.
// The timer_event() function is called repeatedly until it returns FALSE.
g_timeout_add(TIME_INTERVAL, (GSourceFunc) on_timer_event, (gpointer) window);
global_timeout_ref = g_timeout_add(TIME_INTERVAL, (GSourceFunc) on_timer_event,
(gpointer) window);
}
gtk_window_set_title(GTK_WINDOW(window), windowName);

BIN
tek4010

Binary file not shown.

View File

@@ -1,3 +1,9 @@
Version 1.2.3 April 17, 2019
============================
Bug fixes
- fixed a racing condition preventing visibility of some bright spots on slow displays
- hide cursor in full screen mode
Version 1.2.2 April 16, 2019
============================
Bug fixes