Browse Source

port upstream fixes

sisyphus
Dustin Falgout 9 years ago
parent
commit
d523389349
  1. 4
      configure.ac
  2. 1
      src/Makefile.am
  3. 1266
      src/lightdm-webkit2-greeter-ext.c
  4. 49
      src/lightdm-webkit2-greeter.c

4
configure.ac

@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT(lightdm-webkit2-greeter, 0.1.2) AC_INIT(lightdm-webkit2-greeter, 0.2.0)
AC_SUBST(THEME_DIR) AC_SUBST(THEME_DIR)
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
@ -24,7 +24,7 @@ PKG_CHECK_MODULES(GREETER, [
dbus-glib-1 dbus-glib-1
]) ])
PKG_CHECK_MODULES(WEB_EXTENSION, [webkit2gtk-4.0 >= 2.0.0]) PKG_CHECK_MODULES(WEB_EXTENSION, [webkit2gtk-4.0 >= 2.8.0])
AC_SUBST(WEB_EXTENSION_CFLAGS) AC_SUBST(WEB_EXTENSION_CFLAGS)
AC_SUBST(WEB_EXTENSION_LIBS) AC_SUBST(WEB_EXTENSION_LIBS)

1
src/Makefile.am

@ -8,7 +8,6 @@ liblightdm_webkit2_greeter_ext_la_CFLAGS = \
$(GREETER_CFLAGS) \ $(GREETER_CFLAGS) \
$(WARN_CFLAGS) \ $(WARN_CFLAGS) \
-DVERSION=\"$(VERSION)\" \ -DVERSION=\"$(VERSION)\" \
-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
-DLOCALE_DIR=\"$(localedir)\" \ -DLOCALE_DIR=\"$(localedir)\" \
$(WEB_EXTENSION_CFLAGS) $(WEB_EXTENSION_CFLAGS)

1266
src/lightdm-webkit2-greeter-ext.c

File diff suppressed because it is too large Load Diff

49
src/lightdm-webkit2-greeter.c

@ -20,7 +20,7 @@
#include <lightdm.h> #include <lightdm.h>
#include <../config.h> #include <config.h>
static GtkWidget *web_view; static GtkWidget *web_view;
static GtkWidget *window; static GtkWidget *window;
@ -34,33 +34,8 @@ timed_login_cb (LightDMGreeter *greeter, const gchar *username, WebKitWebView *v
command = g_strdup_printf ("timed_login('%s')", username); // FIXME: Escape text command = g_strdup_printf ("timed_login('%s')", username); // FIXME: Escape text
webkit_web_view_run_javascript (view, command, NULL, web_view_javascript_finished, NULL); webkit_web_view_run_javascript (view, command, NULL, web_view_javascript_finished, NULL);
g_free (command); g_free (command);
} }*/
static gboolean
fade_timer_cb (gpointer data)
{
gdouble opacity;
opacity = gtk_widget_get_opacity (window);
opacity -= 0.1;
if (opacity <= 0)
{
gtk_main_quit ();
return FALSE;
}
gtk_widget_set_opacity (window, opacity);
return TRUE;
}
static void
quit_cb (LightDMGreeter *greeter, const gchar *username)
{
// Fade out the greeter
g_timeout_add (40, (GSourceFunc) fade_timer_cb, NULL);
}
*/
static void static void
sigterm_cb (int signum) sigterm_cb (int signum)
@ -74,14 +49,17 @@ main(int argc, char **argv) {
GdkRectangle geometry; GdkRectangle geometry;
GKeyFile *keyfile; GKeyFile *keyfile;
gchar *theme; gchar *theme;
GdkRGBA *bg_color;
WebKitWebContext *context = webkit_web_context_get_default(); WebKitWebContext *context = webkit_web_context_get_default();
webkit_web_context_set_web_extensions_directory(context, LIGHTDM_WEBKIT2_GREETER_EXTENSIONS_DIR);
signal(SIGTERM, sigterm_cb); signal(SIGTERM, sigterm_cb);
gtk_init(&argc, &argv); gtk_init(&argc, &argv);
webkit_web_context_set_web_extensions_directory(context, LIGHTDM_WEBKIT2_GREETER_EXTENSIONS_DIR); gdk_window_set_cursor (gdk_get_default_root_window (), gdk_cursor_new_for_display (gdk_display_get_default (), GDK_LEFT_PTR));
/* settings */ /* settings */
keyfile = g_key_file_new(); keyfile = g_key_file_new();
@ -94,21 +72,14 @@ main(int argc, char **argv) {
gtk_window_set_decorated(GTK_WINDOW(window), FALSE); gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
gdk_screen_get_monitor_geometry(screen, gdk_screen_get_primary_monitor(screen), &geometry); gdk_screen_get_monitor_geometry(screen, gdk_screen_get_primary_monitor(screen), &geometry);
GdkGeometry hints;
hints.min_width = geometry.width;
hints.max_width = geometry.width;
hints.min_height = geometry.height;
hints.max_height = geometry.height;
gtk_window_set_geometry_hints(GTK_WINDOW(window), window, &hints, gtk_window_set_default_size (GTK_WINDOW (window), geometry.width, geometry.height);
(GdkWindowHints)(GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE)); gtk_window_move (GTK_WINDOW (window), geometry.x, geometry.y);
gtk_window_set_default_size(GTK_WINDOW(window), geometry.width, geometry.height);
gtk_window_move(GTK_WINDOW(window), geometry.x, geometry.y);
gdk_window_set_cursor(gdk_get_default_root_window(),
gdk_cursor_new_for_display(gtk_widget_get_display(window), GDK_LEFT_PTR));
web_view = webkit_web_view_new(); web_view = webkit_web_view_new();
gdk_rgba_parse(bg_color, "000000");
webkit_web_view_set_background_color(WEBKIT_WEB_VIEW(web_view), bg_color);
gtk_container_add(GTK_CONTAINER(window), web_view); gtk_container_add(GTK_CONTAINER(window), web_view);

Loading…
Cancel
Save