On Thu, Jul 30, 2009 at 12:37 PM, Carsten Haitzler <[email protected]>wrote:
> On Sat, 11 Jul 2009 15:35:56 -0300 Thiago <[email protected]> said: > > elm_widget_type_get() :) this checks if its a elm_widget smart type (if not > returns "") and if so... returns the type. this is really whats should be > added > to checks everywhere: > > if (elm_widget_type_get()[0]) { > it's an elm widget! > } > You're right! I'll fix it and send it again. I didn't notice that function xD > > nb - also you are assuming its an ecore_evas too to get the win too. so > basically you aleady re-implemented the magic stuff that evas does :) > (elm_widget_type_get() is using it). > What about this last part: EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj) { - Elm_Win *win = (Elm_Win *)elm_widget_data_get(obj); - if (!win) return 0; - _elm_win_xwindow_get(win); - return win->xwin; + Ecore_X_Window xwin = 0; + Ecore_Evas *ee = NULL; + + ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); + if (ee) xwin = (Ecore_X_Window)ecore_evas_window_get(ee); + + return xwin; } Is it ok? > > > Hi guys, > > > > I'm currently working on an IM client plugin for Canola in GSoC. This is > my > > first proposed patch for enlightenment. > > > > The problem begun when I tried to embed a elm widget inside canola. Every > > time I created a widget, with a Edje smart object as parent, I got > > segfaults. So I started investigating why it happaned inside the binding. > > Nothing was wrong with it. Then I looked inside the code for elementary. > > There I found it. All widgets suppose their top father is an evas smart > > object containing a Elm_Win structure as the data field. Thats not true > in > > my case. So the patch changes the function elm_win_xwindow_get() inside > > elm_win.c in a way that it get the xwindow reference from the evas of the > > object, avoiding the corruption of data done by calling > > _elm_win_xwindow_get(). See code for more details. That fixed the first > > problem. > > > > But I kept getting segfaults when I used an entry widget, after I gave it > > the focus. Problem was _on_focus_hook() (elm_entry.c) calling > > elm_win_keyboard_mode_set(). This would also currupt a non-Elm_Win > structure > > pointed by data. So I proposed the creation of a magic field inside > Elm_Win > > to be tested before doing any operations that needs the smart object to > be > > attached to Elm_Win. > > > > The patch is working with tests and everything is working for me! I don't > > know if this is the best solution, but at least it is one. > > > > Waiting on comments! > > > > Thanks. > > > > -- > > Thiago 'bolaum' Borges Abdnur > > ---------------------------------- > > "Trust no one..." > > - Deep Throat (The X-Files) > > > > > -- > ------------- Codito, ergo sum - "I code, therefore I am" -------------- > The Rasterman (Carsten Haitzler) [email protected] > > -- Thiago 'bolaum' Borges Abdnur ---------------------------------- "Trust no one..." - Deep Throat (The X-Files) ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
