aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorhwspeedy <ns@bigbear.dk>2024-05-13 09:04:40 +0200
committerhwspeedy <ns@bigbear.dk>2024-05-13 09:04:40 +0200
commit9eaaf787b3c3291f1ddc127efdaf0f9e8777b488 (patch)
treed6624af3c2f7f4e7333bc248b185741180ba6fdc /modules
parent82866404bb8abf6e10663215e0eb8181de76e52a (diff)
FIX Improve epileptic by more flash removal - improve darkmode detection
Diffstat (limited to 'modules')
-rw-r--r--modules/benchmark/guibench.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/benchmark/guibench.c b/modules/benchmark/guibench.c
index 635f2f53..54b10493 100644
--- a/modules/benchmark/guibench.c
+++ b/modules/benchmark/guibench.c
@@ -19,12 +19,12 @@
#include <gtk/gtk.h>
#include <cairo.h>
-#include "hardinfo.h"
#include "iconcache.h"
#include "config.h"
#define CRUNCH_TIME 3
+static int darkmode;
static int count=0;
static int testnumber=0;
static GTimer *timer,*frametimer;
@@ -72,10 +72,10 @@ gboolean on_draw (GtkWidget *widget, GdkEventExpose *event, gpointer data) {
break;
case 2 : //Filled Shape Drawing
cairo_rectangle(cr,g_rand_int_range(r,0,1024-200),g_rand_int_range(r,0,800-200),g_rand_int_range(r,0,400),g_rand_int_range(r,0,300));
- if(!params.darkmode){
- cairo_set_source_rgb(cr,g_rand_double_range(r,0.3,0.5),g_rand_double_range(r,0.3,0.5),g_rand_double_range(r,0.3,0.5));
+ if(darkmode){
+ cairo_set_source_rgb(cr,g_rand_double_range(r,0.0,0.3),g_rand_double_range(r,0.0,0.3),g_rand_double_range(r,0.0,0.3));
}else{
- cairo_set_source_rgb(cr,g_rand_double_range(r,0.5,0.7),g_rand_double_range(r,0.5,0.7),g_rand_double_range(r,0.5,0.7));
+ cairo_set_source_rgb(cr,g_rand_double_range(r,0.7,0.9),g_rand_double_range(r,0.7,0.9),g_rand_double_range(r,0.7,0.9));
}
cairo_fill(cr);
break;
@@ -131,6 +131,9 @@ double guibench(double *frameTime, int *frameCount)
GtkWindow * window;
cairo_t *cr;
+ //Get DarkMode state from system
+ g_object_get(gtk_settings_get_default(), "gtk-application-prefer-dark-theme", &darkmode, NULL);
+
frametime=frameTime;
framecount=frameCount;