Enlightenment CVS committal Author : pfritz Project : e17 Module : proto
Dir : e17/proto/empower/src/bin/ewl Modified Files: Empower.h empower_cb_ewl.c empower_gui_ewl.c Log Message: let the WM place the window =================================================================== RCS file: /cvs/e/e17/proto/empower/src/bin/ewl/Empower.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- Empower.h 8 Nov 2006 15:35:50 -0000 1.6 +++ Empower.h 12 Feb 2007 22:13:08 -0000 1.7 @@ -14,7 +14,6 @@ Ewl_Widget *win; char password[1024]; char buf[1024]; -int xpos, ypos; /* empower_cb prototypes */ void key_down_cb(Ewl_Widget *w, void *event, void *data); =================================================================== RCS file: /cvs/e/e17/proto/empower/src/bin/ewl/empower_cb_ewl.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- empower_cb_ewl.c 5 Apr 2006 19:40:53 -0000 1.3 +++ empower_cb_ewl.c 12 Feb 2007 22:13:08 -0000 1.4 @@ -1,4 +1,5 @@ #include "Empower.h" +#include <Ecore_X.h> void key_down_cb(Ewl_Widget *w, void *event, void *data) { @@ -24,7 +25,6 @@ void reveal_cb(Ewl_Widget *w, void *event, void *data) { - ewl_window_move(EWL_WINDOW(win), xpos, ypos); ewl_window_raise(EWL_WINDOW(win)); } @@ -33,10 +33,10 @@ FILE *sudo_pipe; const char *pass = ewl_password_text_get(EWL_PASSWORD(data)); - + ewl_widget_destroy(win); ewl_main_quit(); - + if(pass) { snprintf(password, 1024, "%s", pass); =================================================================== RCS file: /cvs/e/e17/proto/empower/src/bin/ewl/empower_gui_ewl.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- empower_gui_ewl.c 3 Feb 2007 03:41:48 -0000 1.15 +++ empower_gui_ewl.c 12 Feb 2007 22:13:08 -0000 1.16 @@ -2,12 +2,6 @@ void display_window(int argc, char** argv) { - if(!ecore_x_init(NULL)) - { - printf("Unable to init ecore\n"); - return; - } - if(!ewl_init(&argc, argv)) { printf("Unable to init ewl\n"); @@ -23,7 +17,6 @@ uid_t user; struct passwd *user_name; char username[256]; - int window_width; user = getuid(); if ((user_name = getpwuid(user)) != NULL) @@ -31,31 +24,15 @@ else snprintf(username, 256, "Your Password"); - window_width = strlen(username)*10; - - int num_roots=0; - int root_w=0, root_h=0; - Ecore_X_Window *root_list = NULL; - root_list = ecore_x_window_root_list(&num_roots); - - /*FIXME: add checks for xinerama*/ - ecore_x_window_size_get(root_list[0], &root_w, &root_h); - - free(root_list); - - xpos = (root_w/2)-(window_width/2); - ypos = (root_h/2)-(HEIGHT/2); - win = ewl_dialog_new(); ewl_window_title_set(EWL_WINDOW(win), "Empower!"); ewl_window_name_set(EWL_WINDOW(win), "Empower!"); ewl_window_class_set(EWL_WINDOW(win), "Empower!"); - ewl_object_size_request(EWL_OBJECT(win), window_width, HEIGHT); - ewl_window_move(EWL_WINDOW(win), xpos, ypos); ewl_window_dialog_set(EWL_WINDOW(win), 1); + ewl_window_transient_for_foreign(EWL_WINDOW(win), NULL); ewl_window_keyboard_grab_set(EWL_WINDOW(win), 1); ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL); - ewl_callback_append(win, EWL_CALLBACK_REVEAL, reveal_cb, NULL); + ewl_callback_prepend(win, EWL_CALLBACK_REVEAL, reveal_cb, NULL); ewl_callback_append(win, EWL_CALLBACK_KEY_DOWN, key_down_cb, NULL); ewl_widget_show(win); @@ -111,7 +88,8 @@ ewl_object_fill_policy_set(EWL_OBJECT(cancel_button), EWL_FLAG_FILL_NONE | EWL_FLAG_FILL_HFILL); ewl_container_child_append(EWL_CONTAINER(win), cancel_button); - ewl_callback_append(cancel_button, EWL_CALLBACK_CLICKED, destroy_cb, NULL); + ewl_callback_append(cancel_button, EWL_CALLBACK_CLICKED, destroy_cb, + NULL); ewl_widget_show(cancel_button); ewl_main(); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs