~indicator-applet-developers/notify-osd/trunk

« back to all changes in this revision

Viewing changes to src/stack.c

  • Committer: Lars Uebernickel
  • Date: 2015-11-03 18:26:21 UTC
  • mto: This revision was merged to the branch mainline in revision 498.
  • Revision ID: lars@uebernic.de-20151103182621-njwjtkjvaqtf6wmi
Listen to xsettings dpi changes

We only listened to font scale factor changes on gsettings, but
retrieved the actual value from xsettings (through gtk-xft-dpi). This is
racy: unity-settings-daemon also listens to gsettings and might not have
set the xsettings value when our handler is run.

Fix this by listening to xsettings changes as well.

This means that we're now listening for both xsettings and gsettings
changes for what is essentially the same thing and recalculate size on
each of them. This creates some unnecessary work, but those settings are
not changed very often. We can't only listen on xsettings, because there
are other gsettings keys that might trigger a change in notification
bubble appearance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
269
269
        bubble_refresh (bubble);
270
270
}
271
271
 
 
272
static Bubble *sync_bubble = NULL;
 
273
 
272
274
static void
273
275
value_changed_handler (Defaults* defaults,
274
276
                       Stack*    stack)
275
277
{
276
278
        if (stack->list != NULL)
277
279
                g_list_foreach (stack->list, _trigger_bubble_redraw, NULL);
 
280
 
 
281
        if (sync_bubble != NULL)
 
282
        {
 
283
                bubble_recalc_size (sync_bubble);
 
284
                bubble_refresh (sync_bubble);
 
285
        }
278
286
}
279
287
 
280
 
static Bubble *sync_bubble = NULL;
281
 
 
282
288
#include "display.c"
283
289
 
284
290
/*-- public API --------------------------------------------------------------*/