Pause frame processing when window is not active
This commit is contained in:
@@ -55,6 +55,7 @@ static char last_path[260] = "";
|
||||
static MPZBarScanResult *zbar_result = NULL;
|
||||
|
||||
// Widgets
|
||||
GtkWidget *window;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *main_stack;
|
||||
GtkWidget *open_last_stack;
|
||||
@@ -90,6 +91,12 @@ remap(int value, int input_min, int input_max, int output_min, int output_max)
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
bool
|
||||
check_window_active()
|
||||
{
|
||||
return gtk_window_is_active(GTK_WINDOW(window));
|
||||
}
|
||||
|
||||
static void
|
||||
update_io_pipeline()
|
||||
{
|
||||
@@ -1126,7 +1133,7 @@ activate(GtkApplication *app, gpointer data)
|
||||
GtkBuilder *builder = gtk_builder_new_from_resource(
|
||||
"/org/postmarketos/Megapixels/camera.ui");
|
||||
|
||||
GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
|
||||
window = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
|
||||
iso_button =
|
||||
GTK_WIDGET(gtk_builder_get_object(builder, "iso-controls-button"));
|
||||
shutter_button = GTK_WIDGET(
|
||||
|
Reference in New Issue
Block a user