Vincent Francois <[email protected]>
Hello,
I am writing to inform of a change in the systray module.
When using the module, some icons are incorrectly placed (Google Desktop,
VideoLan, Claw-Mails ...).
The problem stems from the need to capture the event XConfigureEvent and then
apply the new geometry of the embedded window.
Below, I describe the changes applied to the file
e/src/modules/systray/e_mod_main.c.
// modify _Instance structure
struct _Instance
{
...
struct
{
...
Ecore_Event_Handler *configure;
} handler;
...
};
// new callback function
static int
_systray_cb_window_configure(void *data, int type __UNUSED__, void *event)
{
Ecore_X_Event_Window_Configure *ev = event;
Instance *inst = data;
Icon *icon;
Eina_List *l; EINA_LIST_FOREACH(inst->icons, l, icon)
if (icon->win == ev->win)
{
_systray_icon_geometry_apply(icon);
break;
}
return 1;
}
// add handler
static E_Gadcon_Client *
_gc_init(...)
{
...
inst->handler.configure = ecore_event_handler_add
(ECORE_X_EVENT_WINDOW_CONFIGURE, _systray_cb_window_configure, inst);
...
}
*********
After several tries, I can say that this method is successful.
A patch file is included with this email. To create the patch I used this
command :
$ svn diff e_mod_main.c > e_mod_main.c.patch
I hope that my help will be most useful. If you are looking for a programmer
specializing in low-level programming X11, think of me :)
I would like to participate in the adventure Enlightenment.Index: e_mod_main.c
===================================================================
--- e_mod_main.c (révision 41224)
+++ e_mod_main.c (copie de travail)
@@ -13,6 +13,7 @@
#include "config.h"
#endif
+#include <stdio.h>
#include <e.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
@@ -79,6 +80,7 @@
Ecore_Event_Handler *show;
Ecore_Event_Handler *reparent;
Ecore_Event_Handler *sel_clear;
+ Ecore_Event_Handler *configure;
} handler;
struct
{
@@ -744,6 +746,24 @@
}
static int
+_systray_cb_window_configure(void *data, int type __UNUSED__, void *event)
+{
+ Ecore_X_Event_Window_Configure *ev = event;
+ Instance *inst = data;
+ Icon *icon;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(inst->icons, l, icon)
+ if (icon->win == ev->win)
+ {
+ _systray_icon_geometry_apply(icon);
+ break;
+ }
+
+ return 1;
+}
+
+static int
_systray_cb_reparent_notify(void *data, int type __UNUSED__, void *event)
{
Ecore_X_Event_Window_Reparent *ev = event;
@@ -913,7 +933,7 @@
(0.1, _systray_activate_retry_first, inst);
else
edje_object_signal_emit(inst->ui.gadget, _sig_disable, _sig_source);
- }
+ }
evas_object_event_callback_add(inst->ui.gadget, EVAS_CALLBACK_MOUSE_DOWN,
_systray_cb_mouse_down, inst);
@@ -932,6 +952,8 @@
(ECORE_X_EVENT_WINDOW_REPARENT, _systray_cb_reparent_notify, inst);
inst->handler.sel_clear = ecore_event_handler_add
(ECORE_X_EVENT_SELECTION_CLEAR, _systray_cb_selection_clear, inst);
+ inst->handler.configure = ecore_event_handler_add
+ (ECORE_X_EVENT_WINDOW_CONFIGURE, _systray_cb_window_configure, inst);
instance = inst;
return inst->gcc;
------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel