Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
Makefile.am e_border.c e_border.h e_includes.h e_main.c
e_manager.c e_menu.c e_winlist.c
Added Files:
e_grabinput.c e_grabinput.h
Log Message:
grabinput handling that allows winlist to pop up FROM the menu etc. hmm -
maybe i should have a stack of these too in grabinput that sends the input
back to the previous owner if its still there... and also actually send pings
around to clients every 10 seconds or so - if they dont respond, we have a
function that can do something - but right now it does nothing. shoudl mark
the window as "hung"
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/Makefile.am,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- Makefile.am 18 Jun 2005 15:49:23 -0000 1.35
+++ Makefile.am 20 Jun 2005 08:56:54 -0000 1.36
@@ -61,7 +61,8 @@
e_msg.h \
e_winlist.h \
e_alert.h \
-e_maximize.h
+e_maximize.h \
+e_grabinput.h
enlightenment_SOURCES = \
e_main.c \
@@ -113,6 +114,7 @@
e_winlist.c \
e_alert.c \
e_maximize.c \
+e_grabinput.c \
$(ENLIGHTENMENTHEADERS)
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @x_libs@ @dlopen_libs@
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.275
retrieving revision 1.276
diff -u -3 -r1.275 -r1.276
--- e_border.c 19 Jun 2005 19:00:04 -0000 1.275
+++ e_border.c 20 Jun 2005 08:56:54 -0000 1.276
@@ -116,6 +116,7 @@
static void _e_border_move_update(E_Border *bd);
static int _e_border_cb_focus_fix(void *data);
+static int _e_border_cb_ping_timer(void *data);
static char *_e_border_winid_str_get(Ecore_X_Window win);
@@ -1538,6 +1539,16 @@
}
void
+e_border_ping(E_Border *bd)
+{
+ bd->ping_ok = 0;
+ ecore_x_netwm_ping_send(bd->client.win);
+ bd->ping = ecore_time_get();
+ if (bd->ping_timer) ecore_timer_del(bd->ping_timer);
+ bd->ping_timer = ecore_timer_add(10.0, _e_border_cb_ping_timer, bd);
+}
+
+void
e_border_act_move_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev)
{
if (!bd->moving)
@@ -1645,12 +1656,10 @@
{
if (bd->client.icccm.delete_request)
{
+ bd->delete_requested = 1;
ecore_x_window_delete_request_send(bd->client.win);
if (bd->client.netwm.ping)
- {
- ecore_x_netwm_ping_send(bd->client.win);
- bd->ping = ecore_time_get();
- }
+ e_border_ping(bd);
}
else
e_border_act_kill_begin(bd);
@@ -1806,6 +1815,11 @@
ecore_timer_del(bd->dangling_ref_check);
bd->dangling_ref_check = NULL;
}
+ if (bd->ping_timer)
+ {
+ ecore_timer_del(bd->ping_timer);
+ bd->ping_timer = NULL;
+ }
if (bd->raise_timer)
{
ecore_timer_del(bd->raise_timer);
@@ -3602,6 +3616,13 @@
}
free(proto);
}
+ if (bd->client.netwm.ping)
+ e_border_ping(bd);
+ else
+ {
+ if (bd->ping_timer) ecore_timer_del(bd->ping_timer);
+ bd->ping_timer = NULL;
+ }
bd->client.icccm.fetch.protocol = 0;
}
if (bd->client.mwm.fetch.hints)
@@ -5235,6 +5256,34 @@
return 1;
}
+static int
+_e_border_cb_ping_timer(void *data)
+{
+ E_Border *bd;
+
+ bd = data;
+ if (bd->ping_ok)
+ {
+ /* FIXME: if hung, reset hung state to normal */
+ e_border_ping(bd);
+ }
+ else
+ {
+ /* FIXME: if !hung, set hung state then... */
+ if (bd->delete_requested)
+ {
+ printf("DELETE REQ HUNG: BORDER %p [%s] not responding to
ping!!!!\n",
+ bd, bd->client.icccm.title);
+ }
+ else
+ {
+ printf("HUNG APP: BORDER %p [%s] not responding to ping!!!!\n",
+ bd, bd->client.icccm.title);
+ }
+ }
+ return 1;
+}
+
static char *
_e_border_winid_str_get(Ecore_X_Window win)
{
@@ -5254,3 +5303,4 @@
id[8] = 0;
return id;
}
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.h,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -3 -r1.80 -r1.81
--- e_border.h 19 Jun 2005 19:00:04 -0000 1.80
+++ e_border.h 20 Jun 2005 08:56:54 -0000 1.81
@@ -256,23 +256,25 @@
E_Container_Shape *shape;
- unsigned char visible : 1;
- unsigned char moving : 1;
- unsigned char focused : 1;
- unsigned char new_client : 1;
- unsigned char re_manage : 1;
- unsigned char shading : 1;
- unsigned char shaded : 1;
+ unsigned int visible : 1;
+ unsigned int moving : 1;
+ unsigned int focused : 1;
+ unsigned int new_client : 1;
+ unsigned int re_manage : 1;
+ unsigned int shading : 1;
+ unsigned int shaded : 1;
+ unsigned int iconic : 1;
+ unsigned int sticky : 1;
+ unsigned int shaped : 1;
+ unsigned int need_shape_merge : 1;
+ unsigned int need_shape_export : 1;
+ unsigned int fullscreen : 1;
+ unsigned int already_unparented : 1;
+ unsigned int need_reparent : 1;
+ unsigned int button_grabbed : 1;
+ unsigned int delete_requested : 1;
+ unsigned int ping_ok : 1;
E_Maximize maximized;
- unsigned char iconic : 1;
- unsigned char sticky : 1;
- unsigned char shaped : 1;
- unsigned char need_shape_merge : 1;
- unsigned char need_shape_export : 1;
- unsigned char fullscreen : 1;
- unsigned char already_unparented : 1;
- unsigned char need_reparent : 1;
- unsigned char button_grabbed : 1;
double ping;
@@ -319,6 +321,7 @@
unsigned int layer;
E_Action *cur_mouse_action;
Ecore_Timer *raise_timer;
+ Ecore_Timer *ping_timer;
Ecore_Timer *dangling_ref_check;
};
@@ -464,6 +467,8 @@
EAPI Evas_List *e_border_focus_stack_get(void);
EAPI Evas_List *e_border_lost_windows_get(E_Zone *zone);
+EAPI void e_border_ping(E_Border *bd);
+
extern EAPI int E_EVENT_BORDER_RESIZE;
extern EAPI int E_EVENT_BORDER_MOVE;
extern EAPI int E_EVENT_BORDER_ADD;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_includes.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- e_includes.h 18 Jun 2005 15:49:24 -0000 1.24
+++ e_includes.h 20 Jun 2005 08:56:54 -0000 1.25
@@ -49,3 +49,4 @@
#include "e_winlist.h"
#include "e_alert.h"
#include "e_maximize.h"
+#include "e_grabinput.h"
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -3 -r1.102 -r1.103
--- e_main.c 18 Jun 2005 01:42:13 -0000 1.102
+++ e_main.c 20 Jun 2005 08:56:54 -0000 1.103
@@ -429,6 +429,13 @@
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_dnd_shutdown);
+ /* setup input grabbing co-operation system */
+ if (!e_grabinput_init())
+ {
+ e_error_message_show(_("Enlightenment cannot set up its inptu grab
handling system."));
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(e_grabinput_shutdown);
/* setup module loading etc */
if (!e_module_init())
{
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_manager.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- e_manager.c 17 Jun 2005 20:16:12 -0000 1.34
+++ e_manager.c 20 Jun 2005 08:56:54 -0000 1.35
@@ -527,7 +527,7 @@
bd = e_border_find_by_client_window(e->event_win);
if (!bd) return 1;
- printf("PING response: %f\n", ecore_time_get() - bd->ping);
+ bd->ping_ok = 1;
return 1;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_menu.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- e_menu.c 16 Jun 2005 09:12:44 -0000 1.34
+++ e_menu.c 20 Jun 2005 08:56:54 -0000 1.35
@@ -792,8 +792,12 @@
}
if (!_e_active_menus)
{
- ecore_x_window_del(_e_menu_win);
- _e_menu_win = 0;
+ if (_e_menu_win)
+ {
+ ecore_x_window_del(_e_menu_win);
+ e_grabinput_release(_e_menu_win, _e_menu_win);
+ _e_menu_win = 0;
+ }
}
}
@@ -1465,9 +1469,7 @@
zone->x, zone->y,
zone->w, zone->h);
ecore_x_window_show(_e_menu_win);
- /* need menu event win (input win) and grab to that */
- ecore_x_pointer_confine_grab(_e_menu_win);
- ecore_x_keyboard_grab(_e_menu_win);
+ e_grabinput_get(_e_menu_win, 1, _e_menu_win);
}
if ((m->zone) && (m->zone->container != zone->container))
{
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_winlist.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- e_winlist.c 16 Jun 2005 04:21:01 -0000 1.22
+++ e_winlist.c 20 Jun 2005 08:56:54 -0000 1.23
@@ -140,8 +140,7 @@
input_window = ecore_x_window_input_new(zone->container->win, 0, 0, 1, 1);
ecore_x_window_show(input_window);
- ecore_x_pointer_grab(input_window);
- ecore_x_keyboard_grab(input_window);
+ e_grabinput_get(input_window, 0, input_window);
handlers = evas_list_append
(handlers, ecore_event_handler_add
(E_EVENT_BORDER_ADD, _e_winlist_cb_event_border_add, NULL));
@@ -214,6 +213,7 @@
handlers = evas_list_remove_list(handlers, handlers);
}
ecore_x_window_del(input_window);
+ e_grabinput_release(input_window, input_window);
input_window = 0;
if (warp_timer)
{
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs