Bug fixes and further speed improvement.

Due to the slow touch screen input, I re-wrote some parts of the input handling. I think it is still very ugly but it is much much faster and looks quite robust in the first tests.
main
Zwarf 2023-04-21 21:44:17 +02:00
rodzic 27e26ed6ec
commit f3d598f390
2 zmienionych plików z 8 dodań i 46 usunięć

Wyświetl plik

@ -35,8 +35,6 @@
#define ICON_SIZE_SMALL 32
#define ICON_SIZE_LARGE 48
static guint signal_input_changed;
struct _PicplannerOverview
{
GtkBox parent_instance;
@ -106,7 +104,6 @@ input_timeout_signal (gpointer user_data)
if (overview->input_count == 0)
{
g_print("Change if\n");
overview->input_new = TRUE;
overview->input_currently = TRUE;
overview->input_rebounce_timeout_id = g_timeout_add (5,
@ -140,28 +137,18 @@ input_changed (GtkWidget *self,
if (overview->input_new)
{
overview->input_new = FALSE;
overview->input_timeout_id = g_timeout_add (200,
overview->input_timeout_id = g_timeout_add (100,
input_timeout_signal,
overview);
}
overview->input_count++;
picplanner_overview_remove_map_content (overview);
}
else
{
//overview->input_currently = TRUE;
g_print("Change Else\n");
shumate_location_set_location (SHUMATE_LOCATION (overview->viewport),
g_settings_get_double (overview->settings, "latitude"),
g_settings_get_double (overview->settings, "longitude"));
/*
overview->input_rebounce_timeout_id = g_timeout_add (50,
input_rebounce_reset_signal,
overview);
*/
g_print("Latitude %f, Longitude %f\n",
g_settings_get_double (overview->settings, "latitude"),
g_settings_get_double (overview->settings, "longitude"));
}
}
}
@ -734,14 +721,6 @@ picplanner_overview_init (PicplannerOverview *overview)
G_CALLBACK (input_changed),
overview);
/*
g_settings_bind (overview->settings, "latitude",
overview->viewport, "latitude",
G_SETTINGS_BIND_DEFAULT);
*/
g_settings_bind (overview->settings, "zoom-level",
overview->viewport, "zoom-level",
G_SETTINGS_BIND_DEFAULT);
@ -813,18 +792,6 @@ picplanner_overview_class_init (PicplannerOverviewClass *class)
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, label_azimuth_moon);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, label_azimuth_milky_way);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, basic_information);
/*
* Define the signal that is emitted if the user makes an input.
* The signal is emitted (in the change_date_time function) after a limiter
* that reduces the amount of signals that can be emitted in a specific time interval.
*/
signal_input_changed = g_signal_new ("input-changed",
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE,
0);
}
PicplannerOverview *

Wyświetl plik

@ -31,7 +31,7 @@
* The time of no input of map movement that has to pass until a calculation of the positions
* of sun, moon or milky way starts.
*/
#define INPUT_CHANGED_TIMEOUT_LENGTH 100
#define INPUT_CHANGED_TIMEOUT_LENGTH 50
struct _PicplannerWindow
@ -652,18 +652,13 @@ picplanner_window_init (PicplannerWindow *window)
G_BINDING_BIDIRECTIONAL);
g_signal_connect (G_OBJECT (window->north_entry),
"value-changed",
G_CALLBACK (input_changed_remove_content),
g_signal_connect (G_OBJECT (window->settings),
"changed::latitude",
G_CALLBACK (input_changed),
window);
g_signal_connect (G_OBJECT (window->east_entry),
"value-changed",
G_CALLBACK (input_changed_remove_content),
window);
g_signal_connect (G_OBJECT (window->overview_box),
"input-changed",
g_signal_connect (G_OBJECT (window->settings),
"changed::longitude",
G_CALLBACK (input_changed),
window);