From: Olaf Wintermann Date: Sun, 23 Nov 2025 09:17:43 +0000 (+0100) Subject: use custom xt fallback resources X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=e43eaad1e582b53eeb8e8bba37641efe5ecd2825;p=uwplayer.git use custom xt fallback resources --- diff --git a/application/main.c b/application/main.c index 3bc6101..81c8c8f 100644 --- a/application/main.c +++ b/application/main.c @@ -45,6 +45,7 @@ static Display *display; XtAppContext ui_motif_get_app(void); Display* ui_motif_get_display(void); +void ui_motif_set_fallback_resources(String *fallback); static CxList *open_file_arg; @@ -59,6 +60,10 @@ static String fallback[] = { "*pbbutton.shadowThickness: 1", "*pbbutton.highlightThickness: 1", + "*window_frame.shadowThickness: 0", + "*togglebutton.shadowThickness: 1", + "*togglebutton.highlightThickness: 2", + "*XmText.baseTranslations: #override\\n" \ "Ctrl~Alt~Metav: paste-clipboard()\\n" \ "Ctrl~Alt~Metac: copy-clipboard()\\n" \ @@ -104,6 +109,8 @@ int main(int argc, char** argv) { perror("pipe"); return 2; } + + ui_motif_set_fallback_resources(fallback); // initialize toolkit //XtToolkitInitialize(); diff --git a/ui/motif/toolkit.c b/ui/motif/toolkit.c index 3859000..22190f1 100644 --- a/ui/motif/toolkit.c +++ b/ui/motif/toolkit.c @@ -84,11 +84,17 @@ static String fallback[] = { NULL }; +static String *fallback_resources = fallback; + void input_proc(XtPointer data, int *source, XtInputId *iid) { void *ptr; read(event_pipe[0], &ptr, sizeof(void*)); } +void ui_motif_set_fallback_resources(String *fallbackres) { + fallback_resources = fallbackres; +} + void ui_init(const char *appname, int argc, char **argv) { application_name = appname; uic_init_global_context(); @@ -96,7 +102,7 @@ void ui_init(const char *appname, int argc, char **argv) { XtToolkitInitialize(); XtSetLanguageProc(NULL, NULL, NULL); app = XtCreateApplicationContext(); - XtAppSetFallbackResources(app, fallback); + XtAppSetFallbackResources(app, fallback_resources); display = XtOpenDisplay(app, NULL, appname, appname, NULL, 0, &argc, argv); diff --git a/ui/motif/toolkit.h b/ui/motif/toolkit.h index f4255d5..069e31c 100644 --- a/ui/motif/toolkit.h +++ b/ui/motif/toolkit.h @@ -84,6 +84,7 @@ enum UiOrientation { UI_HORIZONTAL = 0, UI_VERTICAL }; XtAppContext ui_motif_get_app(void); Display* ui_motif_get_display(void); +void ui_motif_set_fallback_resources(String *fallback); void ui_set_active_window(Widget w); Widget ui_get_active_window();