diff options
Diffstat (limited to 'src')
49 files changed, 492 insertions, 398 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index a1c65ed..df8280c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = 1.7 NULL = -saverdir = $(libexecdir)/mate-screensaver +saverdir = $(pkglibexecdir) themesdir = $(pkgdatadir)/themes AM_CPPFLAGS = \ @@ -21,9 +21,11 @@ AM_CPPFLAGS = \ -DDATADIR=\""$(datadir)"\" \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DMATELOCALEDIR=\""$(datadir)/locale"\" \ + -DPKGLIBEXECDIR=\""$(pkglibexecdir)"\" \ -DSAVERDIR=\""$(saverdir)"\" \ -DTHEMESDIR=\""$(themesdir)"\" \ -DGTKBUILDERDIR=\"$(pkgdatadir)\" \ + -DMATE_SCREENSAVER_GL_HELPER_PATH=\""$(libexecdir)/mate-screensaver-gl-helper"\" \ -DPAM_SERVICE_NAME=\""mate-screensaver"\" \ $(WARN_CFLAGS) \ $(AUTH_CFLAGS) \ @@ -57,7 +59,7 @@ desktopdir = $(sysconfdir)/xdg/autostart desktop_in_files = mate-screensaver.desktop.in desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) $(desktop_DATA): $(desktop_in_files) - $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ + $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Name --keyword=Comment --keyword=Keywords --template $< -d $(top_srcdir)/po -o $@ mate_screensaver_command_SOURCES = \ mate-screensaver-command.c \ @@ -69,6 +71,7 @@ mate_screensaver_command_LDADD = \ AUTH_SOURCES = \ gs-auth.h \ + gs-auth-pam.h \ gs-auth-@[email protected] \ $(NULL) @@ -99,6 +102,11 @@ test_passwd_LDADD = \ $(AUTH_LIBS) \ $(NULL) +if HAVE_PASSWD_HELPER +test_passwd_LDADD += \ + ../helper/libhelper-proto.a +endif + test_watcher_SOURCES = \ test-watcher.c \ gs-watcher.h \ @@ -161,6 +169,13 @@ mate_screensaver_dialog_LDADD = \ $(LIBNOTIFY_LIBS) \ $(NULL) +if HAVE_PASSWD_HELPER +mate_screensaver_dialog_LDADD += \ + ../helper/libhelper-proto.a +../helper/libhelper-proto.a: + $(MAKE) -C ../helper +endif + BUILT_SOURCES = \ gs-marshal.c \ gs-marshal.h \ diff --git a/src/copy-theme-dialog.c b/src/copy-theme-dialog.c index a4aaff5..229686c 100644 --- a/src/copy-theme-dialog.c +++ b/src/copy-theme-dialog.c @@ -1,5 +1,6 @@ /* copy-theme-dialog.c * Copyright (C) 2008 John Millikin <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/copy-theme-dialog.h b/src/copy-theme-dialog.h index 4f18546..c2d8ec8 100644 --- a/src/copy-theme-dialog.h +++ b/src/copy-theme-dialog.h @@ -1,5 +1,6 @@ /* copy-theme-dialog.h * Copyright (C) 2008 John Millikin <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-auth-bsdauth.c b/src/gs-auth-bsdauth.c index 3463974..9689b9f 100644 --- a/src/gs-auth-bsdauth.c +++ b/src/gs-auth-bsdauth.c @@ -5,6 +5,7 @@ * Copyright (C) 2006 William Jon McCann <[email protected]> * Copyright (c) 2009 Antoine Jacoutot <[email protected]> * Copyright (c) 2017 Robert Nagy <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/gs-auth-helper.c b/src/gs-auth-helper.c index ea9aefe..8396135 100644 --- a/src/gs-auth-helper.c +++ b/src/gs-auth-helper.c @@ -2,6 +2,7 @@ * * written by Olaf Kirch <[email protected]> * xscreensaver, Copyright (c) 1993-2004 Jamie Zawinski <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -50,6 +51,9 @@ #include "gs-auth.h" #include "subprocs.h" +#include "../helper/helper_proto.h" +#define MAXLEN 1024 + static gboolean verbose_enabled = FALSE; GQuark @@ -78,85 +82,105 @@ gs_auth_get_verbose (void) static gboolean ext_run (const char *user, - const char *typed_passwd, - gboolean verbose) + GSAuthMessageFunc func, + gpointer data) { - int pfd[2], status; - pid_t pid; - - if (pipe (pfd) < 0) - { - return 0; - } - - if (verbose) - { - g_message ("ext_run (%s, %s)", - PASSWD_HELPER_PROGRAM, user); - } - - block_sigchld (); - - if ((pid = fork ()) < 0) - { - close (pfd [0]); - close (pfd [1]); - return FALSE; - } - - if (pid == 0) - { - close (pfd [1]); - if (pfd [0] != 0) - { - dup2 (pfd [0], 0); - } - - /* Helper is invoked as helper service-name [user] */ - execlp (PASSWD_HELPER_PROGRAM, PASSWD_HELPER_PROGRAM, "mate-screensaver", user, NULL); - if (verbose) - { - g_message ("%s: %s", PASSWD_HELPER_PROGRAM, g_strerror (errno)); - } - - exit (1); - } - - close (pfd [0]); - - /* Write out password to helper process */ - if (!typed_passwd) - { - typed_passwd = ""; - } - write (pfd [1], typed_passwd, strlen (typed_passwd)); - close (pfd [1]); - - while (waitpid (pid, &status, 0) < 0) - { - if (errno == EINTR) - { - continue; - } - - if (verbose) - { - g_message ("ext_run: waitpid failed: %s\n", - g_strerror (errno)); - } - - unblock_sigchld (); - return FALSE; - } - - unblock_sigchld (); - - if (! WIFEXITED (status) || WEXITSTATUS (status) != 0) - { - return FALSE; - } - - return TRUE; + int pfd[2], r_pfd[2], status; + pid_t pid; + gboolean verbose = gs_auth_get_verbose (); + + if (pipe (pfd) < 0 || pipe (r_pfd) < 0) + { + return FALSE; + } + + if (verbose) + { + g_message ("ext_run (%s, %s)", + PASSWD_HELPER_PROGRAM, user); + } + + block_sigchld (); + + if ((pid = fork ()) < 0) + { + close (pfd [0]); + close (pfd [1]); + close (r_pfd [0]); + close (r_pfd [1]); + return FALSE; + } + + if (pid == 0) + { + close (pfd [1]); + close (r_pfd [0]); + if (pfd [0] != 0) + { + dup2 (pfd [0], 0); + } + if (r_pfd [1] != 1) + { + dup2 (r_pfd [1], 1); + } + + /* Helper is invoked as helper service-name [user] */ + execlp (PASSWD_HELPER_PROGRAM, PASSWD_HELPER_PROGRAM, "mate-screensaver", user, NULL); + if (verbose) + { + g_message ("%s: %s", PASSWD_HELPER_PROGRAM, g_strerror (errno)); + } + + exit (1); + } + + close (pfd [0]); + close (r_pfd [1]); + + gboolean ret = FALSE; + while (waitpid (pid, &status, WNOHANG) == 0) + { + int msg_type; + char buf[MAXLEN]; + size_t msg_len = MAXLEN; + + msg_type = read_prompt (r_pfd [0], buf, &msg_len); + if (0 == msg_type) continue; + if (msg_type < 0) + { + g_message ("Error reading prompt (%d)", msg_type); + ret = FALSE; + goto exit; + } + + char *input = NULL; + func (msg_type, buf, &input, data); + + unsigned int input_len = input ? strlen (input) : 0; + ssize_t wt; + + wt = write_msg (pfd [1], input, input_len); + if (wt < 0) + { + g_message ("Error writing prompt reply (%li)", wt); + ret = FALSE; + goto exit; + } + } + + close (pfd [1]); + close (r_pfd [0]); + unblock_sigchld (); + + if (! WIFEXITED (status) || WEXITSTATUS (status) != 0) + { + ret = FALSE; + } + else + ret = TRUE; + + exit: + return ret; } gboolean @@ -166,28 +190,7 @@ gs_auth_verify_user (const char *username, gpointer data, GError **error) { - gboolean res = FALSE; - char *password; - - password = NULL; - - /* ask for the password for user */ - if (func != NULL) - { - func (GS_AUTH_MESSAGE_PROMPT_ECHO_OFF, - "Password: ", - &password, - data); - } - - if (password == NULL) - { - return FALSE; - } - - res = ext_run (username, password, gs_auth_get_verbose ()); - - return res; + return ext_run (username, func, data); } gboolean diff --git a/src/gs-auth-pam.c b/src/gs-auth-pam.c index a4961b9..0420b9e 100644 --- a/src/gs-auth-pam.c +++ b/src/gs-auth-pam.c @@ -4,6 +4,7 @@ * Copyright (C) 2006 Ray Strode <[email protected]> * Copyright (C) 2003 Bill Nottingham <[email protected]> * Copyright (c) 1993-2003 Jamie Zawinski <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -45,6 +46,7 @@ #include <gtk/gtk.h> #include "gs-auth.h" +#include "gs-auth-pam.h" #include "subprocs.h" @@ -63,7 +65,6 @@ # define PAM_NO_DELAY(pamh) /* */ #endif /* !HAVE_PAM_FAIL_DELAY */ - /* On SunOS 5.6, and on Linux with PAM 0.64, pam_strerror() takes two args. On some other Linux systems with some other version of PAM (e.g., whichever Debian release comes with a 2.2.5 kernel) it takes one arg. @@ -125,33 +126,6 @@ gs_auth_get_verbose (void) return verbose_enabled; } -static GSAuthMessageStyle -pam_style_to_gs_style (int pam_style) -{ - GSAuthMessageStyle style; - - switch (pam_style) - { - case PAM_PROMPT_ECHO_ON: - style = GS_AUTH_MESSAGE_PROMPT_ECHO_ON; - break; - case PAM_PROMPT_ECHO_OFF: - style = GS_AUTH_MESSAGE_PROMPT_ECHO_OFF; - break; - case PAM_ERROR_MSG: - style = GS_AUTH_MESSAGE_ERROR_MSG; - break; - case PAM_TEXT_INFO: - style = GS_AUTH_MESSAGE_TEXT_INFO; - break; - default: - g_assert_not_reached (); - break; - } - - return style; -} - static gboolean auth_message_handler (GSAuthMessageStyle style, const char *msg, diff --git a/src/gs-auth-pam.h b/src/gs-auth-pam.h new file mode 100644 index 0000000..1d8a66f --- /dev/null +++ b/src/gs-auth-pam.h @@ -0,0 +1,54 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (c) 2019 Paul Wolneykien <[email protected]> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301, USA. + * + */ + +#ifndef __GS_AUTH_PAM_H +#define __GS_AUTH_PAM_H + +#include "gs-auth.h" + +G_BEGIN_DECLS + +static inline GSAuthMessageStyle +pam_style_to_gs_style (int pam_style) +{ + GSAuthMessageStyle style; + + switch (pam_style) + { + case PAM_PROMPT_ECHO_ON: + style = GS_AUTH_MESSAGE_PROMPT_ECHO_ON; + break; + case PAM_PROMPT_ECHO_OFF: + style = GS_AUTH_MESSAGE_PROMPT_ECHO_OFF; + break; + case PAM_ERROR_MSG: + style = GS_AUTH_MESSAGE_ERROR_MSG; + break; + default /* PAM_TEXT_INFO */: + style = GS_AUTH_MESSAGE_TEXT_INFO; + } + + return style; +} + +G_END_DECLS + +#endif /* __GS_AUTH_PAM_H */ diff --git a/src/gs-auth-pwent.c b/src/gs-auth-pwent.c index a0c1d80..377e5cd 100644 --- a/src/gs-auth-pwent.c +++ b/src/gs-auth-pwent.c @@ -2,6 +2,7 @@ * * Copyright (c) 1993-1998 Jamie Zawinski <[email protected]> * Copyright (C) 2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -212,7 +213,6 @@ gs_auth_priv_init (void) } } - gboolean gs_auth_init (void) { diff --git a/src/gs-auth.h b/src/gs-auth.h index 480a56a..ca5710f 100644 --- a/src/gs-auth.h +++ b/src/gs-auth.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/src/gs-debug.c b/src/gs-debug.c index 59f71f8..04a5c83 100644 --- a/src/gs-debug.c +++ b/src/gs-debug.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-debug.h b/src/gs-debug.h index 7bddd51..9f13ab3 100644 --- a/src/gs-debug.h +++ b/src/gs-debug.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-fade.c b/src/gs-fade.c index 4e4995b..5f162d3 100644 --- a/src/gs-fade.c +++ b/src/gs-fade.c @@ -2,6 +2,7 @@ * * Copyright (C) 2004-2009 William Jon McCann <[email protected]> * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,7 +48,6 @@ /* XFree86 4.x+ Gamma fading */ - #ifdef HAVE_XF86VMODE_GAMMA #include <X11/extensions/xf86vmode.h> @@ -224,9 +224,9 @@ xf86_whack_gamma (int screen, for (i = 0; i < gamma_info->size; i++) { - r[i] = gamma_info->r[i] * ratio; - g[i] = gamma_info->g[i] * ratio; - b[i] = gamma_info->b[i] * ratio; + r[i] = (unsigned short) (ratio * (float) gamma_info->r[i]); + g[i] = (unsigned short) (ratio * (float) gamma_info->g[i]); + b[i] = (unsigned short) (ratio * (float) gamma_info->b[i]); } status = XF86VidModeSetGammaRamp (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), screen, gamma_info->size, r, g, b); @@ -256,7 +256,6 @@ xf86_whack_gamma (int screen, # define XF86_VIDMODE_GAMMA_RAMP_MIN_MAJOR 2 # define XF86_VIDMODE_GAMMA_RAMP_MIN_MINOR 1 - gboolean gs_fade_get_enabled (GSFade *fade) { @@ -273,7 +272,7 @@ gs_fade_set_enabled (GSFade *fade, if (fade->priv->enabled != enabled) { - fade->priv->enabled = enabled; + fade->priv->enabled = (enabled != FALSE); } } @@ -306,7 +305,6 @@ gamma_fade_setup (GSFade *fade) { /* have ramps */ - res = XF86VidModeGetGammaRampSize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_SCREEN_XNUMBER (gdk_screen_get_default ()), &screen_priv->info->size); @@ -548,9 +546,9 @@ static void xrandr_crtc_whack_gamma (MateRRCrtc *crtc, for (i = 0; i < gamma_info->size; i++) { - r[i] = gamma_info->r[i] * ratio; - g[i] = gamma_info->g[i] * ratio; - b[i] = gamma_info->b[i] * ratio; + r[i] = (unsigned short) (ratio * (float) gamma_info->r[i]); + g[i] = (unsigned short) (ratio * (float) gamma_info->g[i]); + b[i] = (unsigned short) (ratio * (float) gamma_info->b[i]); } mate_rr_crtc_set_gamma (crtc, gamma_info->size, @@ -654,7 +652,7 @@ gs_fade_out_iter (GSFade *fade) static gboolean gs_fade_stop (GSFade *fade) { - if (fade->priv->timer_id > 0) + if (fade->priv->timer_id != 0) { g_source_remove (fade->priv->timer_id); fade->priv->timer_id = 0; @@ -721,41 +719,28 @@ static void gs_fade_start (GSFade *fade, guint timeout) { - guint steps_per_sec = 60; - guint msecs_per_step; - gboolean active_fade, res; - g_return_if_fail (GS_IS_FADE (fade)); - if (fade->priv->screen_priv.fade_type != FADE_TYPE_NONE) - { - res = fade->priv->screen_priv.fade_setup (fade); - if (res == FALSE) - return; - } + if ((fade->priv->screen_priv.fade_type != FADE_TYPE_NONE) && + (fade->priv->screen_priv.fade_setup (fade) == FALSE)) + return; - if (fade->priv->timer_id > 0) - { + if (fade->priv->timer_id != 0) gs_fade_stop (fade); - } fade->priv->active = TRUE; - gs_fade_set_timeout (fade, timeout); - active_fade = FALSE; if (fade->priv->screen_priv.fade_type != FADE_TYPE_NONE) - active_fade = TRUE; - - if (active_fade) { - guint num_steps; - - num_steps = (fade->priv->timeout / 1000.0) * steps_per_sec; - msecs_per_step = 1000 / steps_per_sec; - fade->priv->alpha_per_iter = 1.0 / (gdouble)num_steps; + double steps_per_sec = 60.0; + double msecs_per_step = 1000.0 / steps_per_sec; + double num_steps = ((double) fade->priv->timeout) / msecs_per_step; - fade->priv->timer_id = g_timeout_add (msecs_per_step, (GSourceFunc)fade_out_timer, fade); + fade->priv->alpha_per_iter = 1.0 / num_steps; + fade->priv->timer_id = g_timeout_add ((guint) msecs_per_step, + (GSourceFunc) fade_out_timer, + fade); } else { diff --git a/src/gs-fade.h b/src/gs-fade.h index 83a8f4a..9ea5a72 100644 --- a/src/gs-fade.h +++ b/src/gs-fade.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-grab-x11.c b/src/gs-grab-x11.c index 689c519..733a01f 100644 --- a/src/gs-grab-x11.c +++ b/src/gs-grab-x11.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -148,8 +149,8 @@ gs_grab_get (GSGrab *grab, (gpointer *) &grab->priv->grab_window); grab->priv->grab_display = display; - grab->priv->no_pointer_grab = no_pointer_grab; - grab->priv->hide_cursor = hide_cursor; + grab->priv->no_pointer_grab = (no_pointer_grab != FALSE); + grab->priv->hide_cursor = (hide_cursor != FALSE); } g_object_unref (G_OBJECT (cursor)); diff --git a/src/gs-grab.h b/src/gs-grab.h index 7c4086c..c0fe350 100644 --- a/src/gs-grab.h +++ b/src/gs-grab.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-job.c b/src/gs-job.c index 7d4c4be..057fcc9 100644 --- a/src/gs-job.c +++ b/src/gs-job.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-job.h b/src/gs-job.h index b154017..8dfa50d 100644 --- a/src/gs-job.h +++ b/src/gs-job.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-listener-dbus.c b/src/gs-listener-dbus.c index f14bb9f..520926d 100644 --- a/src/gs-listener-dbus.c +++ b/src/gs-listener-dbus.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -105,7 +106,7 @@ typedef struct char *connection; guint32 cookie; guint32 foreign_cookie; - GTimeVal since; + gint64 since; } GSListenerRefEntry; enum @@ -362,7 +363,7 @@ gs_listener_set_throttle (GSListener *listener, { gs_debug ("Changing throttle status: %d", throttled); - listener->priv->throttled = throttled; + listener->priv->throttled = (throttled != FALSE); g_signal_emit (listener, signals [THROTTLE_CHANGED], 0, throttled); } @@ -389,7 +390,7 @@ static gboolean listener_set_session_idle_internal (GSListener *listener, gboolean idle) { - listener->priv->session_idle = idle; + listener->priv->session_idle = (idle != FALSE); if (idle) { @@ -407,7 +408,7 @@ static gboolean listener_set_active_internal (GSListener *listener, gboolean active) { - listener->priv->active = active; + listener->priv->active = (active != FALSE); /* if idle not in sync with active, change it */ if (listener->priv->session_idle != active) @@ -495,7 +496,7 @@ gs_listener_set_session_idle (GSListener *listener, } } - listener->priv->session_idle = idle; + listener->priv->session_idle = (idle != FALSE); res = listener_check_activation (listener); /* if activation fails then don't set idle */ @@ -540,7 +541,7 @@ gs_listener_set_activation_enabled (GSListener *listener, if (listener->priv->activation_enabled != enabled) { - listener->priv->activation_enabled = enabled; + listener->priv->activation_enabled = (enabled != FALSE); } } @@ -829,10 +830,12 @@ accumulate_ref_entry (gpointer key, GSListenerRefEntry *entry, DBusMessageIter *iter) { + GDateTime *dt; char *description; char *time; - time = g_time_val_to_iso8601 (&entry->since); + dt = g_date_time_new_from_unix_utc (entry->since); + time = g_date_time_format_iso8601 (dt); description = g_strdup_printf ("Application=\"%s\"; Since=\"%s\"; Reason=\"%s\";", entry->application, @@ -843,6 +846,7 @@ accumulate_ref_entry (gpointer key, g_free (description); g_free (time); + g_date_time_unref (dt); } static DBusHandlerResult @@ -905,7 +909,7 @@ listener_add_ck_ref_entry (GSListener *listener, entry->cookie = listener_generate_unique_key (listener, entry_type); entry->application = g_strdup ("ConsoleKit"); entry->reason = g_strdup ("Session is not active"); - g_get_current_time (&entry->since); + entry->since = g_get_real_time () / G_USEC_PER_SEC; /* takes ownership of entry */ listener_add_ref_entry (listener, entry_type, entry); @@ -972,7 +976,7 @@ listener_dbus_add_ref_entry (GSListener *listener, entry->cookie = listener_generate_unique_key (listener, entry_type); entry->application = g_strdup (application); entry->reason = g_strdup (reason); - g_get_current_time (&entry->since); + entry->since = g_get_real_time () / G_USEC_PER_SEC; listener_add_ref_entry (listener, entry_type, entry); @@ -2207,7 +2211,6 @@ gs_listener_class_init (GSListenerClass *klass) G_PARAM_READWRITE)); } - static gboolean screensaver_is_running (DBusConnection *connection) { diff --git a/src/gs-listener-dbus.h b/src/gs-listener-dbus.h index 8f1192c..c264254 100644 --- a/src/gs-listener-dbus.h +++ b/src/gs-listener-dbus.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c index 3283302..bcb6a86 100644 --- a/src/gs-lock-plug.c +++ b/src/gs-lock-plug.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,6 +59,9 @@ #define KEY_LOCK_DIALOG_THEME "lock-dialog-theme" +#define KEY_LOCK_DIALOG_T_FMT "lock-dialog-time-format" +#define KEY_LOCK_DIALOG_D_FMT "lock-dialog-date-format" + #define MDM_FLEXISERVER_COMMAND "mdmflexiserver" #define MDM_FLEXISERVER_ARGS "--startnew Standard" @@ -132,7 +136,6 @@ struct _ResponseData gint response_id; }; - enum { RESPONSE, @@ -293,12 +296,42 @@ date_time_update (GSLockPlug *plug) GDateTime *datetime; gchar *time; gchar *date; + gchar *tfmt; + gchar *dfmt; + gchar *str; + GSettings *settings; + + settings = g_settings_new (GSETTINGS_SCHEMA); + tfmt = g_settings_get_string (settings, KEY_LOCK_DIALOG_T_FMT); + dfmt = g_settings_get_string (settings, KEY_LOCK_DIALOG_D_FMT); + g_object_unref (settings); + + /* Time/Date formating https://developer.gnome.org/glib/stable/glib-GDateTime.html#g-date-time-format */ + datetime = g_date_time_new_now_local (); - time = g_date_time_format (datetime, "%X"); - /* Translators: Date format, see https://developer.gnome.org/glib/stable/glib-GDateTime.html#g-date-time-format */ - date = g_date_time_format (datetime, _("%A, %B %e")); + if (g_strcmp0(tfmt, "locale") == 0) + { + // Use locale default format + time = g_date_time_format (datetime, "%X"); + } + else + { + // Apply user defined format + time = g_date_time_format (datetime, tfmt); + } + + if (g_strcmp0(dfmt, "locale") == 0) + { + // Use locale default format + date = g_date_time_format (datetime, _("%A, %B %e")); + } + else + { + // Apply user defined format + date = g_date_time_format (datetime, dfmt); + } str = g_strdup_printf ("<span size=\"xx-large\" weight=\"ultrabold\">%s</span>", time); gtk_label_set_text (GTK_LABEL (plug->priv->auth_time_label), str); @@ -312,6 +345,8 @@ date_time_update (GSLockPlug *plug) g_free (time); g_free (date); + g_free (tfmt); + g_free (dfmt); g_date_time_unref (datetime); } @@ -419,7 +454,6 @@ dialog_timed_out (gpointer user_data) return FALSE; } - static void capslock_update (GSLockPlug *plug, gboolean is_on) @@ -650,7 +684,6 @@ gs_lock_plug_run (GSLockPlug *plug) return ri.response_id; } - static cairo_surface_t * surface_from_pixbuf (GdkPixbuf *pixbuf) { @@ -835,7 +868,6 @@ frame_pixbuf (GdkPixbuf *source) h); rowstride = gdk_pixbuf_get_rowstride (dest); - data = g_new0 (guint8, h * rowstride); surface = cairo_image_surface_create_for_data (data, @@ -1019,7 +1051,6 @@ gs_lock_plug_show (GtkWidget *widget) gs_profile_end ("parent"); - if (plug->priv->auth_face_image) { set_face_image (plug); @@ -1692,8 +1723,8 @@ expand_string (const char *text) GString *str; const char *p; char *username; - int i; - int n_chars; + glong i; + glong n_chars; struct utsname name; str = g_string_sized_new (strlen (text)); diff --git a/src/gs-lock-plug.h b/src/gs-lock-plug.h index 818c8e6..f4b30ab 100644 --- a/src/gs-lock-plug.h +++ b/src/gs-lock-plug.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-manager.c b/src/gs-manager.c index f1490d9..96b54fb 100644 --- a/src/gs-manager.c +++ b/src/gs-manager.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2008 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -266,7 +267,6 @@ manager_select_theme_for_job (GSManager *manager, gs_job_set_command (job, command); - if (info != NULL) { gs_theme_info_unref (info); @@ -418,7 +418,7 @@ gs_manager_set_throttled (GSManager *manager, { GSList *l; - manager->priv->throttled = throttled; + manager->priv->throttled = (throttled != FALSE); if (! manager->priv->dialog_up) { @@ -462,7 +462,7 @@ gs_manager_set_lock_active (GSManager *manager, { GSList *l; - manager->priv->lock_active = lock_active; + manager->priv->lock_active = (lock_active != FALSE); for (l = manager->priv->windows; l; l = l->next) { gs_window_set_lock_enabled (l->data, lock_active); @@ -495,7 +495,7 @@ gs_manager_set_lock_enabled (GSManager *manager, if (manager->priv->lock_enabled != lock_enabled) { - manager->priv->lock_enabled = lock_enabled; + manager->priv->lock_enabled = (lock_enabled != FALSE); } } @@ -509,7 +509,7 @@ gs_manager_set_logout_enabled (GSManager *manager, { GSList *l; - manager->priv->logout_enabled = logout_enabled; + manager->priv->logout_enabled = (logout_enabled != FALSE); for (l = manager->priv->windows; l; l = l->next) { gs_window_set_logout_enabled (l->data, logout_enabled); @@ -527,7 +527,7 @@ gs_manager_set_keyboard_enabled (GSManager *manager, { GSList *l; - manager->priv->keyboard_enabled = enabled; + manager->priv->keyboard_enabled = (enabled != FALSE); for (l = manager->priv->windows; l; l = l->next) { gs_window_set_keyboard_enabled (l->data, enabled); @@ -545,7 +545,7 @@ gs_manager_set_user_switch_enabled (GSManager *manager, { GSList *l; - manager->priv->user_switch_enabled = user_switch_enabled; + manager->priv->user_switch_enabled = (user_switch_enabled != FALSE); for (l = manager->priv->windows; l; l = l->next) { gs_window_set_user_switch_enabled (l->data, user_switch_enabled); @@ -1074,7 +1074,6 @@ remove_unfade_idle (GSManager *manager) } } - static gboolean window_deactivated_idle (gpointer data) { @@ -1229,7 +1228,6 @@ unfade_idle (GSManager *manager) return FALSE; } - static void add_unfade_idle (GSManager *manager) { diff --git a/src/gs-manager.h b/src/gs-manager.h index 4e537fe..73f93cd 100644 --- a/src/gs-manager.h +++ b/src/gs-manager.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-monitor.c b/src/gs-monitor.c index 7edf714..304126a 100644 --- a/src/gs-monitor.c +++ b/src/gs-monitor.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-monitor.h b/src/gs-monitor.h index de8053e..6796174 100644 --- a/src/gs-monitor.h +++ b/src/gs-monitor.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-prefs.c b/src/gs-prefs.c index 3c3c074..0d2bea0 100644 --- a/src/gs-prefs.c +++ b/src/gs-prefs.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,6 +56,15 @@ static void gs_prefs_finalize (GObject *object); #define KEY_KEYBOARD_COMMAND "embedded-keyboard-command" #define KEY_STATUS_MESSAGE_ENABLED "status-message-enabled" +#define _gs_prefs_set_idle_activation_enabled(x,y) ((x)->idle_activation_enabled = ((y) != FALSE)) +#define _gs_prefs_set_lock_enabled(x,y) ((x)->lock_enabled = ((y) != FALSE)) +#define _gs_prefs_set_lock_disabled(x,y) ((x)->lock_disabled = ((y) != FALSE)) +#define _gs_prefs_set_user_switch_disabled(x,y) ((x)->user_switch_disabled = ((y) != FALSE)) +#define _gs_prefs_set_keyboard_enabled(x,y) ((x)->keyboard_enabled = ((y) != FALSE)) +#define _gs_prefs_set_status_message_enabled(x,y) ((x)->status_message_enabled = ((y) != FALSE)) +#define _gs_prefs_set_logout_enabled(x,y) ((x)->logout_enabled = ((y) != FALSE)) +#define _gs_prefs_set_user_switch_enabled(x,y) ((x)->user_switch_enabled = ((y) != FALSE)) + struct GSPrefsPrivate { GSettings *settings; @@ -114,7 +124,6 @@ gs_prefs_class_init (GSPrefsClass *klass) object_class->get_property = gs_prefs_get_property; object_class->set_property = gs_prefs_set_property; - signals [CHANGED] = g_signal_new ("changed", G_TYPE_FROM_CLASS (object_class), @@ -212,41 +221,6 @@ _gs_prefs_set_themes (GSPrefs *prefs, } static void -_gs_prefs_set_idle_activation_enabled (GSPrefs *prefs, - gboolean value) -{ - prefs->idle_activation_enabled = value; -} - -static void -_gs_prefs_set_lock_enabled (GSPrefs *prefs, - gboolean value) -{ - prefs->lock_enabled = value; -} - -static void -_gs_prefs_set_lock_disabled (GSPrefs *prefs, - gboolean value) -{ - prefs->lock_disabled = value; -} - -static void -_gs_prefs_set_user_switch_disabled (GSPrefs *prefs, - gboolean value) -{ - prefs->user_switch_disabled = value; -} - -static void -_gs_prefs_set_keyboard_enabled (GSPrefs *prefs, - gboolean value) -{ - prefs->keyboard_enabled = value; -} - -static void _gs_prefs_set_keyboard_command (GSPrefs *prefs, const char *value) { @@ -262,20 +236,6 @@ _gs_prefs_set_keyboard_command (GSPrefs *prefs, } static void -_gs_prefs_set_status_message_enabled (GSPrefs *prefs, - gboolean enabled) -{ - prefs->status_message_enabled = enabled; -} - -static void -_gs_prefs_set_logout_enabled (GSPrefs *prefs, - gboolean value) -{ - prefs->logout_enabled = value; -} - -static void _gs_prefs_set_logout_command (GSPrefs *prefs, const char *value) { @@ -306,13 +266,6 @@ _gs_prefs_set_logout_timeout (GSPrefs *prefs, } static void -_gs_prefs_set_user_switch_enabled (GSPrefs *prefs, - gboolean value) -{ - prefs->user_switch_enabled = value; -} - -static void gs_prefs_load_from_settings (GSPrefs *prefs) { glong value; diff --git a/src/gs-prefs.h b/src/gs-prefs.h index 3b5957d..dd2cceb 100644 --- a/src/gs-prefs.h +++ b/src/gs-prefs.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-theme-manager.c b/src/gs-theme-manager.c index 15f1354..da622a9 100644 --- a/src/gs-theme-manager.c +++ b/src/gs-theme-manager.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -392,11 +393,25 @@ get_themes_tree (void) } static void +on_applications_changed (MateMenuTree *menu_tree) +{ + GError *error = NULL; + + if (!matemenu_tree_load_sync (menu_tree, &error)) { + g_debug ("Load matemenu tree got error: %s\n", error->message); + g_error_free (error); + } +} + +static void gs_theme_manager_init (GSThemeManager *theme_manager) { theme_manager->priv = gs_theme_manager_get_instance_private (theme_manager); theme_manager->priv->menu_tree = get_themes_tree (); + g_signal_connect (theme_manager->priv->menu_tree, "changed", + G_CALLBACK (on_applications_changed), + NULL); } static void diff --git a/src/gs-theme-manager.h b/src/gs-theme-manager.h index 5c03189..a420cb9 100644 --- a/src/gs-theme-manager.h +++ b/src/gs-theme-manager.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-visual-gl.c b/src/gs-visual-gl.c index 2ba8fc3..03d6213 100644 --- a/src/gs-visual-gl.c +++ b/src/gs-visual-gl.c @@ -2,6 +2,7 @@ * * Copyright (C) 2006 William Jon McCann <[email protected]> * Copyright (C) 1999, 2000, 2003 Jamie Zawinski <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/src/gs-visual-gl.h b/src/gs-visual-gl.h index 4b1493a..81a000d 100644 --- a/src/gs-visual-gl.h +++ b/src/gs-visual-gl.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-watcher-x11.c b/src/gs-watcher-x11.c index 58ea07e..f3f44e1 100644 --- a/src/gs-watcher-x11.c +++ b/src/gs-watcher-x11.c @@ -2,6 +2,7 @@ * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,11 +89,11 @@ remove_watchdog_timer (GSWatcher *watcher) static void add_watchdog_timer (GSWatcher *watcher, - glong timeout) + guint timeout) { watcher->priv->watchdog_timer_id = g_timeout_add (timeout, - (GSourceFunc)watchdog_timer, - watcher); + (GSourceFunc)watchdog_timer, + watcher); } static void @@ -202,7 +203,7 @@ _gs_watcher_set_session_idle_notice (GSWatcher *watcher, { gs_debug ("Changing idle notice state: %d", in_effect); - watcher->priv->idle_notice = in_effect; + watcher->priv->idle_notice = (in_effect != FALSE); } else { @@ -229,7 +230,7 @@ _gs_watcher_set_session_idle (GSWatcher *watcher, { gs_debug ("Changing idle state: %d", is_idle); - watcher->priv->idle = is_idle; + watcher->priv->idle = (is_idle != FALSE); } else { @@ -268,7 +269,7 @@ _gs_watcher_set_active_internal (GSWatcher *watcher, /* reset state */ _gs_watcher_reset_state (watcher); - watcher->priv->active = active; + watcher->priv->active = (active != FALSE); } return TRUE; @@ -308,7 +309,7 @@ gs_watcher_set_enabled (GSWatcher *watcher, { gboolean is_active = gs_watcher_get_active (watcher); - watcher->priv->enabled = enabled; + watcher->priv->enabled = (enabled != FALSE); /* if we are disabling the watcher and we are active shut it down */ @@ -641,7 +642,6 @@ disable_builtin_screensaver (GSWatcher *watcher, } } - /* This timer goes off every few minutes, whether the user is idle or not, to try and clean up anything that has gone wrong. diff --git a/src/gs-watcher.h b/src/gs-watcher.h index e844fe1..ca48e3b 100644 --- a/src/gs-watcher.h +++ b/src/gs-watcher.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c index b8df256..7d6c530 100644 --- a/src/gs-window-x11.c +++ b/src/gs-window-x11.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2008 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,6 +56,7 @@ enum #define MAX_QUEUED_EVENTS 16 #define INFO_BAR_SECONDS 30 +#define MATE_SCREENSAVER_DIALOG_PATH LIBEXECDIR "/mate-screensaver-dialog" struct GSWindowPrivate { @@ -505,7 +507,6 @@ static GdkVisual * get_best_visual_for_display (GdkDisplay *display) { GdkScreen *screen; - char *command; char *std_output; int exit_status; GError *error; @@ -517,19 +518,18 @@ get_best_visual_for_display (GdkDisplay *display) visual = NULL; screen = gdk_display_get_default_screen (display); - command = g_build_filename (LIBEXECDIR, "mate-screensaver-gl-helper", NULL); - error = NULL; std_output = NULL; res = spawn_command_line_on_display_sync (display, - command, + MATE_SCREENSAVER_GL_HELPER_PATH, &std_output, NULL, &exit_status, &error); if (! res) { - gs_debug ("Could not run command '%s': %s", command, error->message); + gs_debug ("Could not run command '%s': %s", + MATE_SCREENSAVER_GL_HELPER_PATH, error->message); g_error_free (error); goto out; } @@ -550,7 +550,6 @@ get_best_visual_for_display (GdkDisplay *display) } out: g_free (std_output); - g_free (command); return g_object_ref (visual); } @@ -616,11 +615,11 @@ remove_watchdog_timer (GSWindow *window) static void add_watchdog_timer (GSWindow *window, - glong timeout) + guint timeout) { window->priv->watchdog_timer_id = g_timeout_add (timeout, - (GSourceFunc)watchdog_timer, - window); + (GSourceFunc)watchdog_timer, + window); } static void @@ -1534,7 +1533,7 @@ window_set_dialog_up (GSWindow *window, return; } - window->priv->dialog_up = dialog_up; + window->priv->dialog_up = (dialog_up != FALSE); g_object_notify (G_OBJECT (window), "dialog-up"); } @@ -1696,14 +1695,11 @@ static void popup_dialog (GSWindow *window) { gboolean result; - char *tmp; GString *command; gs_debug ("Popping up dialog"); - tmp = g_build_filename (LIBEXECDIR, "mate-screensaver-dialog", NULL); - command = g_string_new (tmp); - g_free (tmp); + command = g_string_new (MATE_SCREENSAVER_DIALOG_PATH); if (is_logout_enabled (window)) { @@ -1818,7 +1814,7 @@ gs_window_set_lock_enabled (GSWindow *window, return; } - window->priv->lock_enabled = lock_enabled; + window->priv->lock_enabled = (lock_enabled != FALSE); g_object_notify (G_OBJECT (window), "lock-enabled"); } @@ -1836,7 +1832,7 @@ gs_window_set_keyboard_enabled (GSWindow *window, { g_return_if_fail (GS_IS_WINDOW (window)); - window->priv->keyboard_enabled = enabled; + window->priv->keyboard_enabled = (enabled != FALSE); } void @@ -1863,7 +1859,7 @@ gs_window_set_logout_enabled (GSWindow *window, { g_return_if_fail (GS_IS_WINDOW (window)); - window->priv->logout_enabled = logout_enabled; + window->priv->logout_enabled = (logout_enabled != FALSE); } void @@ -1872,7 +1868,7 @@ gs_window_set_user_switch_enabled (GSWindow *window, { g_return_if_fail (GS_IS_WINDOW (window)); - window->priv->user_switch_enabled = user_switch_enabled; + window->priv->user_switch_enabled = (user_switch_enabled != FALSE); } void @@ -2282,7 +2278,7 @@ window_set_obscured (GSWindow *window, return; } - window->priv->obscured = obscured; + window->priv->obscured = (obscured != FALSE); g_object_notify (G_OBJECT (window), "obscured"); } diff --git a/src/gs-window.h b/src/gs-window.h index 33bad7f..31631d4 100644 --- a/src/gs-window.h +++ b/src/gs-window.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/mate-screensaver-command.c b/src/mate-screensaver-command.c index 77cfd27..a233ebe 100644 --- a/src/mate-screensaver-command.c +++ b/src/mate-screensaver-command.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -107,7 +108,7 @@ static GOptionEntry entries [] = "version", 'V', 0, G_OPTION_ARG_NONE, &do_version, N_("Version of this application"), NULL }, - { NULL } + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } }; static GMainLoop *loop = NULL; diff --git a/src/mate-screensaver-dialog.c b/src/mate-screensaver-dialog.c index 03ca5bf..567d094 100644 --- a/src/mate-screensaver-dialog.c +++ b/src/mate-screensaver-dialog.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -61,7 +62,7 @@ static GOptionEntry entries[] = { {"enable-switch", 0, 0, G_OPTION_ARG_NONE, &enable_switch, N_("Show the switch user button"), NULL}, {"status-message", 0, 0, G_OPTION_ARG_STRING, &status_message, N_("Message to show in the dialog"), N_("MESSAGE")}, {"away-message", 0, 0, G_OPTION_ARG_STRING, &away_message, N_("Not used"), N_("MESSAGE")}, - {NULL} + {NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL} }; static char* get_id_string(GtkWidget* widget) @@ -420,7 +421,6 @@ static gboolean popup_dialog_idle(gpointer data) return FALSE; } - /* * Copyright (c) 1991-2004 Jamie Zawinski <[email protected]> * Copyright (c) 2005 William Jon McCann <[email protected]> @@ -465,7 +465,6 @@ privileged_initialization (int* argc, char** argv) return ret; } - /* * Copyright (c) 1991-2004 Jamie Zawinski <[email protected]> * Copyright (c) 2005 William Jon McCann <[email protected]> diff --git a/src/mate-screensaver-gl-helper.c b/src/mate-screensaver-gl-helper.c index 472aefd..438dd60 100644 --- a/src/mate-screensaver-gl-helper.c +++ b/src/mate-screensaver-gl-helper.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c index 44e0c7b..1bcdcaf 100644 --- a/src/mate-screensaver-preferences.c +++ b/src/mate-screensaver-preferences.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -92,10 +93,10 @@ static GSettings *session_settings = NULL; static GSettings *lockdown_settings = NULL; static MateDesktopThumbnailFactory *thumb_factory = NULL; -static gint32 +static gdouble config_get_activate_delay (gboolean *is_writable) { - gint32 delay; + gint delay; if (is_writable) { @@ -103,14 +104,12 @@ config_get_activate_delay (gboolean *is_writable) KEY_IDLE_DELAY); } - delay = g_settings_get_int (session_settings, KEY_IDLE_DELAY); - - if (delay < 1) + if ((delay = g_settings_get_int (session_settings, KEY_IDLE_DELAY)) < 1) { - delay = 1; + return 1.0; } - return delay; + return (gdouble) delay; } static void @@ -119,6 +118,31 @@ config_set_activate_delay (gint32 timeout) g_settings_set_int (session_settings, KEY_IDLE_DELAY, timeout); } +static gdouble +config_get_lock_delay (gboolean *is_writable) +{ + gint delay; + + if (is_writable) + { + *is_writable = g_settings_is_writable (screensaver_settings, + KEY_LOCK_DELAY); + } + + if ((delay = g_settings_get_int (screensaver_settings, KEY_LOCK_DELAY)) < 1) + { + return 0.0; + } + + return (gdouble) delay; +} + +static void +config_set_lock_delay (gint32 timeout) +{ + g_settings_set_int (screensaver_settings, KEY_LOCK_DELAY, timeout); +} + static int config_get_mode (gboolean *is_writable) { @@ -577,6 +601,16 @@ activate_delay_value_changed_cb (GtkRange *range, config_set_activate_delay ((gint32)value); } +static void +lock_delay_value_changed_cb (GtkRange *range, + gpointer user_data) +{ + gdouble value; + + value = gtk_range_get_value (range); + config_set_lock_delay ((gint32)value); +} + static int compare_theme_names (char *name_a, char *name_b, @@ -662,19 +696,20 @@ separator_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { - int column = GPOINTER_TO_INT (data); - char *text; + int column = GPOINTER_TO_INT (data); + gboolean res = FALSE; + char *text; gtk_tree_model_get (model, iter, column, &text, -1); if (text != NULL && strcmp (text, "__separator") == 0) { - return TRUE; + res = TRUE; } g_free (text); - return FALSE; + return res; } static void @@ -720,7 +755,7 @@ setup_treeview (GtkWidget *tree, select = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree)); gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (select), "changed", + g_signal_connect (select, "changed", G_CALLBACK (tree_selection_changed_cb), preview); @@ -933,10 +968,8 @@ drag_data_received_cb (GtkWidget *widget, static char * time_to_string_text (long time) { - char *secs, *mins, *hours, *string; - int sec, min, hour; - - int n, inc_len, len_minutes; + char *secs, *mins, *hours, *string; + int sec, min, hour; sec = time % 60; time = time - sec; @@ -953,60 +986,17 @@ time_to_string_text (long time) secs = g_strdup_printf (ngettext ("%d second", "%d seconds", sec), sec); - inc_len = strlen (g_strdup_printf (_("%s %s"), - g_strdup_printf (ngettext ("%d hour", - "%d hours", 1), 1), - g_strdup_printf (ngettext ("%d minute", - "%d minutes", 59), 59))) - 1; - - len_minutes = 0; - - for (n = 2; n < 60; n++) - { - if (n < 10) - { - if ((strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute", - "%d minutes", n), n), NULL)) - 2) > len_minutes) - - len_minutes = strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute", - "%d minutes", n), n), NULL)) - 2; - } - else - { - if ((strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute", - "%d minutes", n), n), NULL)) - 3) > len_minutes) - - len_minutes = strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute", - "%d minutes", n), n), NULL)) - 3; - } - } - - if ((strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute", - "%d minutes", 1), 1), NULL)) - 2) > len_minutes) - - len_minutes = strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute", - "%d minutes", 1), 1), NULL)) - 2; - - if (len_minutes < 1) - len_minutes = 1; - if (hour > 0) { if (sec > 0) - { /* hour:minutes:seconds */ string = g_strdup_printf (_("%s %s %s"), hours, mins, secs); - } else if (min > 0) - { /* hour:minutes */ string = g_strdup_printf (_("%s %s"), hours, mins); - } else - { /* hour */ string = g_strdup_printf (_("%s"), hours); - } } else if (min > 0) { @@ -1019,36 +1009,6 @@ time_to_string_text (long time) { /* minutes */ string = g_strdup_printf (_("%s"), mins); - - if (min < 10) - { - if (min == 1) - while (strlen (string) != (len_minutes + inc_len + 3)) - { - if (strlen (string) % 2 == 0) - string = g_strconcat (string, " ", NULL); - else - string = g_strconcat (" " , string, NULL); - } - else - while (strlen (string) != (len_minutes + inc_len)) - { - if (strlen (string) % 2 == 0) - string = g_strconcat (string, " ", NULL); - else - string = g_strconcat (" " , string, NULL); - } - } - else - { - while (strlen (string) != (len_minutes + inc_len - 1)) - { - if (strlen (string) % 2 == 0) - string = g_strconcat (string, " ", NULL); - else - string = g_strconcat (" " , string, NULL); - } - } } } else @@ -1068,10 +1028,70 @@ static char * format_value_callback_time (GtkScale *scale, gdouble value) { + gchar *time_str, *big_time_str; + GtkAdjustment *adj; + gdouble lower, range, delta; + gint pad_size; + + /* get the value representation as a string */ if (value == 0) - return g_strdup_printf (_("Never")); + time_str = g_strdup (_("Never")); + else + time_str = time_to_string_text ((long) (value * 60.0)); + + /* Now, adjust the string so the representation for the bounds are the + * longest ones, and try and adjust the length as smoothly as possible. + * The issue here is that GTK is using the lower and upper value + * representations to compute the largest expected value's bounding box, + * so those need to be bigger than anything else we might represent, + * otherwise layout gets messed up (wraps and overflows). To achieve this, + * we pad the values near each bound so its length is at least the same as + * the biggest actual value. We cannot really do anything perfect here + * because what matters is the pango layout size for the largest value, but + * we don't have access to enough information to create one matching what + * GTK will actually use, and even so it'd be trial-and-error until the + * layout is big enough. So the silly assumptions below are probably good + * enough. */ + adj = gtk_range_get_adjustment (GTK_RANGE (scale)); + lower = gtk_adjustment_get_lower (adj); + range = gtk_adjustment_get_upper (adj) - lower; + delta = range / 2 - (value - lower); + /* the largest (character-wise) time string we expect */ + big_time_str = time_to_string_text (7199 /* 1:59:59 */); + pad_size = ((g_utf8_strlen (big_time_str, -1) * (ABS (delta) / range)) - + g_utf8_strlen (time_str, -1)); + g_free (big_time_str); + if (pad_size > 0) + { + /* pad string with EM SPACE (U+2003) */ + GString *padded = g_string_new (NULL); + + /* adjust pad side in RTL locales that aren't actually translated, as + * a properly translated one would have text drawn RTL already */ + if (gtk_widget_get_direction (GTK_WIDGET (scale)) == GTK_TEXT_DIR_RTL) + { + const gchar *msg_plural = "%d minutes"; + if (ngettext ("%d minute", msg_plural, 2) == msg_plural) + delta *= -1; + } - return time_to_string_text (value * 60.0); + if (delta < 0) + { + for (gint i = 0; i < pad_size; i++) + g_string_append_unichar (padded, 0x2003); + g_string_append (padded, time_str); + } + else + { + g_string_append (padded, time_str); + for (gint i = 0; i < pad_size; i++) + g_string_append_unichar (padded, 0x2003); + } + g_free (time_str); + time_str = g_string_free (padded, FALSE); + } + + return time_str; } static void @@ -1089,7 +1109,11 @@ enabled_checkbox_toggled (GtkToggleButton *button, gpointer user_data) static void picture_filename_changed (GtkFileChooserButton *button, gpointer user_data) { - g_settings_set_string (screensaver_settings, "picture-filename", gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (button))); + char *picture_filename; + + picture_filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (button)); + g_settings_set_string (screensaver_settings, "picture-filename", picture_filename); + g_free (picture_filename); } static void @@ -1149,11 +1173,11 @@ ui_set_enabled (gboolean enabled) } static void -ui_set_delay (int delay) +ui_set_delay (const char *name, gdouble delay) { GtkWidget *widget; - widget = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_hscale")); + widget = GTK_WIDGET (gtk_builder_get_object (builder, name)); gtk_range_set_value (GTK_RANGE (widget), delay); } @@ -1196,8 +1220,14 @@ key_changed_cb (GSettings *settings, const gchar *key, gpointer data) int delay; delay = g_settings_get_int (settings, key); - ui_set_delay (delay); + ui_set_delay ("activate_delay_hscale", (gdouble) delay); + } + else if (strcmp (key, KEY_LOCK_DELAY) == 0) + { + int delay; + delay = g_settings_get_int (settings, key); + ui_set_delay ("lock_delay_hscale", (gdouble) delay); } else { @@ -1419,12 +1449,10 @@ spawn_command_line_on_display_sync (GdkDisplay *display, return retval; } - static GdkVisual * get_best_visual_for_display (GdkDisplay *display) { GdkScreen *screen; - char *command; char *std_output; int exit_status; GError *error; @@ -1436,19 +1464,18 @@ get_best_visual_for_display (GdkDisplay *display) visual = NULL; screen = gdk_display_get_default_screen (display); - command = g_build_filename (LIBEXECDIR, "mate-screensaver-gl-helper", NULL); - error = NULL; std_output = NULL; res = spawn_command_line_on_display_sync (display, - command, + MATE_SCREENSAVER_GL_HELPER_PATH, &std_output, NULL, &exit_status, &error); if (! res) { - gs_debug ("Could not run command '%s': %s", command, error->message); + gs_debug ("Could not run command '%s': %s", + MATE_SCREENSAVER_GL_HELPER_PATH, error->message); g_error_free (error); goto out; } @@ -1469,12 +1496,10 @@ get_best_visual_for_display (GdkDisplay *display) } out: g_free (std_output); - g_free (command); return visual; } - static void widget_set_best_visual (GtkWidget *widget) { @@ -1598,7 +1623,7 @@ init_capplet (void) GtkWidget *treeview; GtkWidget *list_scroller; GtkWidget *activate_delay_hscale; - GtkWidget *activate_delay_hbox; + GtkWidget *lock_delay_hscale; GtkWidget *label; GtkWidget *enabled_checkbox; GtkWidget *lock_checkbox; @@ -1647,7 +1672,7 @@ init_capplet (void) treeview = GTK_WIDGET (gtk_builder_get_object (builder, "savers_treeview")); list_scroller = GTK_WIDGET (gtk_builder_get_object (builder, "themes_scrolled_window")); activate_delay_hscale = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_hscale")); - activate_delay_hbox = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_hbox")); + lock_delay_hscale = GTK_WIDGET (gtk_builder_get_object (builder, "lock_delay_hscale")); enabled_checkbox = GTK_WIDGET (gtk_builder_get_object (builder, "enable_checkbox")); lock_checkbox = GTK_WIDGET (gtk_builder_get_object (builder, "lock_checkbox")); root_warning_label = GTK_WIDGET (gtk_builder_get_object (builder, "root_warning_label")); @@ -1662,6 +1687,8 @@ init_capplet (void) label = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_label")); gtk_label_set_mnemonic_widget (GTK_LABEL (label), activate_delay_hscale); + label = GTK_WIDGET (gtk_builder_get_object (builder, "lock_delay_label")); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), lock_delay_hscale); label = GTK_WIDGET (gtk_builder_get_object (builder, "savers_label")); gtk_label_set_mnemonic_widget (GTK_LABEL (label), treeview); @@ -1693,14 +1720,23 @@ init_capplet (void) NULL); activate_delay = config_get_activate_delay (&is_writable); - ui_set_delay (activate_delay); + ui_set_delay ("activate_delay_hscale", activate_delay); if (! is_writable) { - gtk_widget_set_sensitive (activate_delay_hbox, FALSE); + gtk_widget_set_sensitive (activate_delay_hscale, FALSE); } g_signal_connect (activate_delay_hscale, "format-value", G_CALLBACK (format_value_callback_time), NULL); + activate_delay = config_get_lock_delay (&is_writable); + ui_set_delay ("lock_delay_hscale", activate_delay); + if (! is_writable) + { + gtk_widget_set_sensitive (lock_delay_hscale, FALSE); + } + g_signal_connect (lock_delay_hscale, "format-value", + G_CALLBACK (format_value_callback_time), NULL); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lock_checkbox), config_get_lock (&is_writable)); if (! is_writable) { @@ -1772,6 +1808,9 @@ init_capplet (void) g_signal_connect (activate_delay_hscale, "value-changed", G_CALLBACK (activate_delay_value_changed_cb), NULL); + g_signal_connect (lock_delay_hscale, "value-changed", + G_CALLBACK (lock_delay_value_changed_cb), NULL); + g_signal_connect (dialog, "response", G_CALLBACK (response_cb), NULL); diff --git a/src/mate-screensaver.c b/src/mate-screensaver.c index 04add35..e2f8b3a 100644 --- a/src/mate-screensaver.c +++ b/src/mate-screensaver.c @@ -1,6 +1,7 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- * * Copyright (C) 2004-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -55,7 +56,7 @@ int main(int argc, char **argv) {"version", 0, 0, G_OPTION_ARG_NONE, &show_version, N_("Version of this application"), NULL}, {"no-daemon", 0, 0, G_OPTION_ARG_NONE, &no_daemon, N_("Don't become a daemon"), NULL}, {"debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL}, - {NULL} + {NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL} }; #ifdef ENABLE_NLS diff --git a/src/mate-screensaver.h b/src/mate-screensaver.h index 2a5830a..55b2657 100644 --- a/src/mate-screensaver.h +++ b/src/mate-screensaver.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2004-2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/setuid.c b/src/setuid.c index 0a065d9..5784230 100644 --- a/src/setuid.c +++ b/src/setuid.c @@ -3,6 +3,7 @@ * setuid.c --- management of runtime privileges. * * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -155,7 +156,6 @@ set_ids_by_number (uid_t uid, return FALSE; } - /* If we've been run as setuid or setgid to someone else (most likely root) turn off the extra permissions so that random user-specified programs don't get special privileges. (On some systems it is necessary to install @@ -228,7 +228,6 @@ hack_uid (char **nolock_reason, } } - /* Locking can't work when running as root, because we have no way of knowing what the user id of the logged in user is (so we don't know whose password to prompt for.) diff --git a/src/setuid.h b/src/setuid.h index 89b0b8e..8379478 100644 --- a/src/setuid.h +++ b/src/setuid.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * xscreensaver, Copyright (c) 1993-2004 Jamie Zawinski <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/src/subprocs.c b/src/subprocs.c index 757daf8..969375c 100644 --- a/src/subprocs.c +++ b/src/subprocs.c @@ -4,6 +4,7 @@ * * xscreensaver, Copyright (c) 1991-2003 Jamie Zawinski <[email protected]> * Modified: Copyright (c) 2004 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -50,7 +51,6 @@ */ static int block_sigchld_handler = 0; - #ifdef HAVE_SIGACTION sigset_t #else /* !HAVE_SIGACTION */ @@ -156,7 +156,6 @@ await_dying_children (int pid, } } - #else /* VMS */ static void await_dying_children (saver_info *si) { diff --git a/src/subprocs.h b/src/subprocs.h index a3acf22..b941082 100644 --- a/src/subprocs.h +++ b/src/subprocs.h @@ -3,6 +3,7 @@ * subprocs.c --- choosing, spawning, and killing screenhacks. * * xscreensaver, Copyright (c) 1991-2003 Jamie Zawinski <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/src/test-fade.c b/src/test-fade.c index 6a82d21..961998b 100644 --- a/src/test-fade.c +++ b/src/test-fade.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/src/test-passwd.c b/src/test-passwd.c index 9359fb1..debfb21 100644 --- a/src/test-passwd.c +++ b/src/test-passwd.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2005-2006 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -72,7 +73,6 @@ privileged_initialization (void) return ret; } - /* Figure out what locking mechanisms are supported. */ static gboolean diff --git a/src/test-watcher.c b/src/test-watcher.c index 9b56063..e669c7d 100644 --- a/src/test-watcher.c +++ b/src/test-watcher.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/src/test-window.c b/src/test-window.c index 3233c36..399eb67 100644 --- a/src/test-window.c +++ b/src/test-window.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2005 William Jon McCann <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as |