~ubuntu-branches/ubuntu/trusty/pinentry/trusty

« back to all changes in this revision

Viewing changes to gtk+-2/gtksecentry.c

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2009-06-24 14:05:14 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140514-sw1bmaalt6bydgmk
Tags: 0.7.6-0ubuntu1
* New upstream release (LP: #390895).
* debian/patches/gmalloc-prototypes.patch: Removed, fixed upstream.
* debian/patches/keyboard-race.patch: updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
270
270
 
271
271
 
272
272
gpointer
273
 
g_malloc(gulong size)
 
273
secentry_malloc (GMALLOC_SIZE size)
274
274
{
275
275
    gpointer p;
276
276
 
287
287
    return p;
288
288
}
289
289
 
290
 
gpointer
291
 
g_malloc0(gulong size)
292
 
{
293
 
    gpointer p;
294
 
 
295
 
    if (size == 0)
296
 
        return NULL;
297
 
 
298
 
    if (g_use_secure_mem) {
299
 
        p = (gpointer) secmem_malloc(size);
300
 
        if (p)
301
 
            memset(p, 0, size);
302
 
    } else
303
 
        p = (gpointer) calloc(size, 1);
304
 
    if (!p)
305
 
        g_error("could not allocate %ld bytes", size);
306
 
 
307
 
    return p;
308
 
}
309
 
 
310
 
gpointer
311
 
g_realloc(gpointer mem, gulong size)
 
290
 
 
291
gpointer
 
292
secentry_realloc (gpointer mem, GMALLOC_SIZE size)
312
293
{
313
294
    gpointer p;
314
295
 
338
319
}
339
320
 
340
321
void
341
 
g_free(gpointer mem)
 
322
secentry_free(gpointer mem)
342
323
{
343
324
    if (mem) {
344
325
        if (m_is_secure(mem))
684
665
                                 GDK_CONTROL_MASK, "delete_from_cursor", 2,
685
666
                                 G_TYPE_ENUM, GTK_DELETE_WORD_ENDS,
686
667
                                 G_TYPE_INT, -1);
687
 
 
688
 
    gtk_settings_install_property(g_param_spec_boolean
689
 
                                  ("gtk-entry-select-on-focus",
690
 
                                   _("Select on focus"),
691
 
                                   _
692
 
                                   ("Whether to select the contents of an entry when it is focused"),
693
 
                                   TRUE, G_PARAM_READWRITE));
694
668
}
695
669
 
696
670
static void
1368
1342
static void
1369
1343
gtk_secure_entry_grab_focus(GtkWidget * widget)
1370
1344
{
 
1345
    GtkWidget *tmp;
1371
1346
    GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget);
1372
1347
    gboolean select_on_focus;
1373
1348
 
1374
1349
    GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT);
1375
1350
    GTK_WIDGET_CLASS(parent_class)->grab_focus(widget);
1376
1351
 
1377
 
    g_object_get(gtk_widget_get_settings(widget),
 
1352
    /* read current select on focus setting from GtkEntry */
 
1353
    tmp = gtk_entry_new ();
 
1354
    g_object_get(gtk_widget_get_settings(tmp),
1378
1355
                 "gtk-entry-select-on-focus", &select_on_focus, NULL);
 
1356
    gtk_widget_destroy (tmp);
1379
1357
 
1380
1358
    if (select_on_focus && !entry->in_click)
1381
1359
        gtk_editable_select_region(GTK_EDITABLE(widget), 0, -1);