When you open a pointer grabbing window during the evas mouse down
callback, evas doesn't get the mouse up event feeded and turns to be
unusable, because every mouse actions are blocked because the evas
believes that the mouse is still dragged.
If found a work-around for it, but it would be nice to fix it in evas or
ecore_evas.
Attached you find a program that shows this behavior.
Start it.
Click on the white area, nothing is printed because there is no callback
registered for it.
Right click on the red rectangle, a green window will be opened in the
left top corner.
Click on it to close it.
Click on the white area, and a message is printed from the callback of
the red rectangle.
I hope there is a way to fix that in general.
Peter
/* vim: set sw=8 ts=8 sts=8 noexpandtab: */
#include <Evas.h>
#include <Ecore.h>
#include <Ecore_X.h>
#include <Ecore_Evas.h>
#include <stdio.h>
Evas_Object *bg;
static void
destroy_main_window(Ecore_Evas *ee)
{
ecore_main_loop_quit();
}
static void
destroy_second_window(void * data, Evas * e, Evas_Object * obj,
void * event_info)
{
Ecore_Evas *ee = data;
ecore_evas_free(ee);
}
static void
resize_window(Ecore_Evas *ee)
{
Evas_Coord w, h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
evas_object_resize(bg, w, h);
}
static void
open_window(void * data, Evas * e, Evas_Object * obj, void * event_info)
{
Evas_Event_Mouse_Down * ev;
Ecore_Evas *ee;
Evas *evas;
Evas_Object *o;
ev = (Evas_Event_Mouse_Down *) event_info;
printf("mouse down: %d\n", ev->button);
if (ev->button != 3)
return;
/*
* setup ecore evas
*/
ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 100, 20);
ecore_evas_override_set(ee, 1);
ecore_evas_title_set(ee, "Second");
ecore_evas_raise(ee);
ecore_evas_show(ee);
ecore_x_pointer_grab(ecore_evas_software_x11_window_get(ee));
evas = ecore_evas_get(ee);
o = evas_object_rectangle_add(evas);
evas_object_move(o, 0, 0);
evas_object_resize(o, 300, 300);
evas_object_color_set(o, 0, 255, 0, 255);
evas_object_show(o);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
destroy_second_window, ee);
//evas_event_feed_mouse_up(e, ev->button, 0, ev->timestamp, NULL);
}
int
main(int argc, char **argv)
{
Evas_Object *rect;
Ecore_Evas *ee;
Evas *evas;
/*
* initialize
*/
evas_init();
ecore_evas_init();
/*
* setup ecore evas
*/
ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 300, 300);
ecore_evas_title_set(ee, "Test Case");
ecore_evas_callback_delete_request_set(ee, destroy_main_window);
ecore_evas_callback_resize_set(ee, resize_window);
ecore_evas_size_min_set(ee, 300, 300);
ecore_evas_show(ee);
evas = ecore_evas_get(ee);
/* the background */
bg = evas_object_rectangle_add(evas);
evas_object_move(bg, 0, 0);
evas_object_resize(bg, 300, 300);
evas_object_show(bg);
/* the rectangle */
rect = evas_object_rectangle_add(evas);
evas_object_color_set(rect, 255, 0, 0, 255);
evas_object_move(rect, 100, 100);
evas_object_resize(rect, 100, 100);
evas_object_show(rect);
evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN,
open_window, NULL);
ecore_main_loop_begin();
return 0;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel