[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: Checking when SCREEN_RESOURCES property is updated
From:       "Chris Sorenson" <csoren () cpinternet ! com>
Date:       2022-01-09 16:56:58
Message-ID: 1641747418.0czpvnl80owok404 () webmail ! mycci ! net
[Download RAW message or body]

> 

> Today's Topics:
> 
> 1. Checking when SCREEN_RESOURCES property is updated (Xaro)
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 07 Jan 2022 08:29:50 +0000
> From: Xaro
> To: xorg@lists.x.org
> Subject: Checking when SCREEN_RESOURCES property is updated
> Message-ID: <3d4c9e62-5bcb-4238-8e4c-dd1689e810a7@www.fastmail.com>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hello,
> 
> I have an application that reads some Xresources file configs to update its theme.
> 
> So i use XOpenDisplay, XResourceManagerString and XrmGetStringDatabase from
> libx11 to get the fields that i want.
> 
> My problem is when the user update the Xresources file then run `xrdb \
> ~/.Xresources` my version of the database is not updated, and i don't know how to \
> detect such an event. 
> I can retrieve the theme for example every 10 seconds but that is too much. Is \
> there a way or a blocking function I can use to detect if the SCREEN_RESOURCES
> property for a screen has been updated so that i can retrieve it and update the
> application theme?
> 
> I'm not very knowledgeable about C or X11 in general but I'm trying my best to \
> learn, couldn't find what i want in the documentation.
> 
> If someone knows the direction i should be looking for I will really appreciate it.
> 
> Thanks.
> 

At the risk of being overly obvious, you do realize you can pass in your resources as \
the sixth argument to XtOpenApplication, yes?

Like so:

String fallbacks[] = 
{
"myAppClassName*background: #ff0000",
  "myAppClassName*foreground: #ffffff",
"myAppClassName*XmList.fontList: -*-courier-medium-r-*--12-*",
"myAppClassName*XmText.fontList: -*-courier-medium-r-*--12-*",
  /* list the rest of the default resources here ... */
  NULL
};


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic