[haiku-development] Re: Who should save input settings?

  • From: Pascal Abresch <nep@xxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 6 Sep 2020 07:30:43 +0200



On 5. Sep 2020, at 21:28, Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> wrote:

Hi there,

I am reviewing Preetpal's work and am finding some strange design
choices in the existing code :)

Currently, both the input_server and the Input preferences will write
the mouse settings file whenever one of the mouse settings changes. This
seems rather useless. Who should do it? Should the preference panel
never touch the settings file, and get the settings from input_server?

That would be the simplest way, but then every change of setting results
in a disk access, which isn't great. If done in the input preferences,
we could just tell the input server to change the setting "live", and
write the file only once when exiting the preference app.

What do you think?

-- 
Adrien.

I think the input server should do it, live as you say, and then decide on its 
own when to save, maybe the preferences panel can send it a stopped editing 
message?

In that way it would work neatly if any third party apps ever add their own 
devices or virtual devices and would like to offer a gui to configure them in 
their application.

Mfg,
Pascal abresch

Other related posts: