summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 55d9702)
raw | patch | inline | side by side (parent: 55d9702)
author | Eric Wertz <ericdwertz@gmail.com> | |
Fri, 30 Jun 2017 19:43:26 +0000 (15:43 -0400) | ||
committer | Eric Wertz <ericdwertz@gmail.com> | |
Fri, 30 Jun 2017 19:43:26 +0000 (15:43 -0400) |
main.c | patch | blob | history |
index 1d665e2d2eb9dee5f105512690728b30f77d2f8f..8da39ec67c68280cc3379042e8fa9abbdddb9baa 100644 (file)
--- a/main.c
+++ b/main.c
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,width,height,0,GL_RGB,GL_UNSIGNED_BYTE,pixels);
}
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,width,height,0,GL_RGB,GL_UNSIGNED_BYTE,pixels);
}
+gboolean suspend_timer( gpointer user )
+{
+ system( "xset dpms force suspend" );
+}
+
gboolean animation_timer( gpointer user )
{
int i;
gboolean animation_timer( gpointer user )
{
int i;
gtk_window_set_decorated( GTK_WINDOW( w->window ), FALSE );
//gtk_window_set_keep_above( GTK_WINDOW( w->window ), TRUE );
gtk_widget_set_can_focus( w->window, TRUE );
gtk_window_set_decorated( GTK_WINDOW( w->window ), FALSE );
//gtk_window_set_keep_above( GTK_WINDOW( w->window ), TRUE );
gtk_widget_set_can_focus( w->window, TRUE );
+ gtk_window_set_skip_taskbar_hint( GTK_WINDOW( w->window ), TRUE );
+ gtk_window_set_skip_pager_hint( GTK_WINDOW( w->window ), TRUE );
gtk_widget_add_events( w->window, GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK );
g_signal_connect( G_OBJECT(w->window), "button-press-event", G_CALLBACK(button_press_event), NULL );
g_signal_connect( G_OBJECT(w->window), "key-press-event", G_CALLBACK(key_press_event), NULL );
gtk_widget_add_events( w->window, GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK );
g_signal_connect( G_OBJECT(w->window), "button-press-event", G_CALLBACK(button_press_event), NULL );
g_signal_connect( G_OBJECT(w->window), "key-press-event", G_CALLBACK(key_press_event), NULL );
old_ns = tp.tv_nsec;
g_timeout_add( 16, animation_timer, NULL );
old_ns = tp.tv_nsec;
g_timeout_add( 16, animation_timer, NULL );
+ g_timeout_add_seconds( 600, suspend_timer, NULL );
+
grab_keys();
gtk_main();
grab_keys();
gtk_main();