lightdash: Preferences window freezes after opening dashboard

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

lightdash: Preferences window freezes after opening dashboard

adlo
I am writing a panel plugin called lightdash, which aims to be a lightweight GNOME Shell-like dashboard for Xfce.

After opening the dashboard, the preferences window freezes. I have narrowed it down to an issue with GDK event filters, as it works properly when I remove the call to gdk_window_add_filter () here:

https://github.com/adlocode/xfce4-lightdash-plugin/blob/master/src/lightdash-window-switcher.c#L1301

I am not sure how to resolve this issue; does anyone have any ideas?

Regards

adlo


_______________________________________________
Xfce4-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce4-dev
Reply | Threaded
Open this post in threaded view
|

Re: lightdash: Preferences window freezes after opening dashboard

Jonas Kümmerlin
lightdash_window_event doesn't return a value (i.e. returns void) where it
should return a GdkFilterReturn [1]. This WILL wreck havoc some way or another
and might well be responsible for the symptoms you're experiencing.

[1] https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkFilterFunc

Am Freitag, den 04.09.2015, 18:21 +0100 schrieb adlo:

> I am writing a panel plugin called lightdash, which aims to be a lightweight
> GNOME Shell-like dashboard for Xfce.
>
> After opening the dashboard, the preferences window freezes. I have narrowed
> it down to an issue with GDK event filters, as it works properly when I remove
> the call to gdk_window_add_filter () here:
>
> https://github.com/adlocode/xfce4-lightdash-plugin/blob/master/src/lightdash-w
> indow-switcher.c#L1301
>
> I am not sure how to resolve this issue; does anyone have any ideas?
>
> Regards
>
> adlo
>
>
> _______________________________________________
> Xfce4-dev mailing list
> [hidden email]
> https://mail.xfce.org/mailman/listinfo/xfce4-dev
_______________________________________________
Xfce4-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce4-dev
Reply | Threaded
Open this post in threaded view
|

Re: lightdash: Preferences window freezes after opening dashboard

Ricardo Biehl
In reply to this post by adlo
I'm not an expert in Gtk, Gdk and X libraries, but it's appearing a
bad rule in your code or in the libraries, that then interfere in the
preferences window.
If it's not in your code, it will be in the Gdk (or Gtk) library.

2015-09-04 14:21 GMT-03:00 adlo <[hidden email]>:

> I am writing a panel plugin called lightdash, which aims to be a lightweight GNOME Shell-like dashboard for Xfce.
>
> After opening the dashboard, the preferences window freezes. I have narrowed it down to an issue with GDK event filters, as it works properly when I remove the call to gdk_window_add_filter () here:
>
> https://github.com/adlocode/xfce4-lightdash-plugin/blob/master/src/lightdash-window-switcher.c#L1301
>
> I am not sure how to resolve this issue; does anyone have any ideas?
>
> Regards
>
> adlo
>
>
> _______________________________________________
> Xfce4-dev mailing list
> [hidden email]
> https://mail.xfce.org/mailman/listinfo/xfce4-dev



--
Ricardo Biehl Pasquali
_______________________________________________
Xfce4-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce4-dev
Reply | Threaded
Open this post in threaded view
|

Re: lightdash: Preferences window freezes after opening dashboard

adlo
In reply to this post by Jonas Kümmerlin
Thanks for that, that's fixed it! Should I return GDK_FILTER_CONTINUE or GDK_FILTER_REMOVE?

Regards

adlo



> On 4 Sep 2015, at 18:55, Jonas Kümmerlin <[hidden email]> wrote:
>
> lightdash_window_event doesn't return a value (i.e. returns void) where it
> should return a GdkFilterReturn [1]. This WILL wreck havoc some way or another
> and might well be responsible for the symptoms you're experiencing.
>
> [1] https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkFilterFunc
>
> Am Freitag, den 04.09.2015, 18:21 +0100 schrieb adlo:
>> I am writing a panel plugin called lightdash, which aims to be a lightweight
>> GNOME Shell-like dashboard for Xfce.
>>
>> After opening the dashboard, the preferences window freezes. I have narrowed
>> it down to an issue with GDK event filters, as it works properly when I remove
>> the call to gdk_window_add_filter () here:
>>
>> https://github.com/adlocode/xfce4-lightdash-plugin/blob/master/src/lightdash-w
>> indow-switcher.c#L1301
>>
>> I am not sure how to resolve this issue; does anyone have any ideas?
>>
>> Regards
>>
>> adlo
>>
>>
>> _______________________________________________
>> Xfce4-dev mailing list
>> [hidden email]
>> https://mail.xfce.org/mailman/listinfo/xfce4-dev
> _______________________________________________
> Xfce4-dev mailing list
> [hidden email]
> https://mail.xfce.org/mailman/listinfo/xfce4-dev
_______________________________________________
Xfce4-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce4-dev
Reply | Threaded
Open this post in threaded view
|

Re: lightdash: Preferences window freezes after opening dashboard

Matthew Brush
On 15-09-04 01:28 PM, adlo wrote:
> Thanks for that, that's fixed it! [...]
>

FYI, you can trivially find problems like that by using stronger
compiler warnings like `-Wall -Wextra -Werror`. That way it will almost
never compile successfully if you have such bugs in your code.

Cheers,
Matthew Brush

>
>
>> On 4 Sep 2015, at 18:55, Jonas Kümmerlin <[hidden email]> wrote:
>>
>> lightdash_window_event doesn't return a value (i.e. returns void) where it
>> should return a GdkFilterReturn [1]. This WILL wreck havoc some way or another
>> and might well be responsible for the symptoms you're experiencing.
>>
>> [1] https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkFilterFunc
>>
>> Am Freitag, den 04.09.2015, 18:21 +0100 schrieb adlo:
>>> I am writing a panel plugin called lightdash, which aims to be a lightweight
>>> GNOME Shell-like dashboard for Xfce.
>>>
>>> After opening the dashboard, the preferences window freezes. I have narrowed
>>> it down to an issue with GDK event filters, as it works properly when I remove
>>> the call to gdk_window_add_filter () here:
>>>
>>> https://github.com/adlocode/xfce4-lightdash-plugin/blob/master/src/lightdash-w
>>> indow-switcher.c#L1301
>>>
>>> I am not sure how to resolve this issue; does anyone have any ideas?
>>>
>>> Regards
>>>
>>> adlo
>>>
>>>
>>> _______________________________________________
>>> Xfce4-dev mailing list
>>> [hidden email]
>>> https://mail.xfce.org/mailman/listinfo/xfce4-dev
>> _______________________________________________
>> Xfce4-dev mailing list
>> [hidden email]
>> https://mail.xfce.org/mailman/listinfo/xfce4-dev
> _______________________________________________
> Xfce4-dev mailing list
> [hidden email]
> https://mail.xfce.org/mailman/listinfo/xfce4-dev
>

_______________________________________________
Xfce4-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce4-dev
Reply | Threaded
Open this post in threaded view
|

Re: lightdash: Preferences window freezes after opening dashboard

Jonas Kümmerlin
Am Freitag, den 04.09.2015, 17:35 -0700 schrieb Matthew Brush:
> FYI, you can trivially find problems like that by using stronger
> compiler warnings like `-Wall -Wextra -Werror`. That way it will almost
> never compile successfully if you have such bugs in your code.

Nope, the explicit cast will shut up any warnings.
 
Unless you also make sure the callback has the explicit same prototype as
expected so you can get rid of the cast. Which might have been possible (but not
necessarily better coding style) in this case, but is not universally useful
e.g. when connecting gobject signals.
_______________________________________________
Xfce4-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce4-dev
Reply | Threaded
Open this post in threaded view
|

Re: lightdash: Preferences window freezes after opening dashboard

Matthew Brush
On 15-09-05 11:00 AM, Jonas Kümmerlin wrote:
> Am Freitag, den 04.09.2015, 17:35 -0700 schrieb Matthew Brush:
>> FYI, you can trivially find problems like that by using stronger
>> compiler warnings like `-Wall -Wextra -Werror`. That way it will almost
>> never compile successfully if you have such bugs in your code.
>
> Nope, the explicit cast will shut up any warnings.
>

Ah, I didn't look at the code, I was assuming it was a function with a
return type not returning anything (so defaulting to int). Yeah, casting
away what little bit of type-safety C offers is a sure way to get the
compiler to ignore your bugs :)

> Unless you also make sure the callback has the explicit same prototype as
> expected so you can get rid of the cast. Which might have been possible (but not

It's safer, at least. Compiler warnings/errors are much better than
manually finding such bugs by code-review/debugging.

> necessarily better coding style) in this case, but is not universally useful
> e.g. when connecting gobject signals.
>

Indeed, though I wouldn't consider that a good feature/style of the
GObject API. It's actually not even technically valid C code because
GObject casts the callback function pointer to a void*, which AFAIK
isn't permitted by the standard, but luckily it works on the compilers
most people care about.

Cheers,
Matthew Brush
_______________________________________________
Xfce4-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce4-dev
Reply | Threaded
Open this post in threaded view
|

Re: lightdash: Preferences window freezes after opening dashboard

Ricardo Biehl
In reply to this post by adlo
2015-09-04 17:28 GMT-03:00 adlo <[hidden email]>:
> Thanks for that, that's fixed it! Should I return GDK_FILTER_CONTINUE or GDK_FILTER_REMOVE?
>
According with Gdk spec
<https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkFilterReturn>
I think you should return 'GDK_FILTER_REMOVE'.
See the page.

>
> Regards
>
> adlo
>
>
>
>> On 4 Sep 2015, at 18:55, Jonas Kümmerlin <[hidden email]> wrote:
>>
>> lightdash_window_event doesn't return a value (i.e. returns void) where it
>> should return a GdkFilterReturn [1]. This WILL wreck havoc some way or another
>> and might well be responsible for the symptoms you're experiencing.
>>
>> [1] https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkFilterFunc
>>
>> Am Freitag, den 04.09.2015, 18:21 +0100 schrieb adlo:
>>> I am writing a panel plugin called lightdash, which aims to be a lightweight
>>> GNOME Shell-like dashboard for Xfce.
>>>
>>> After opening the dashboard, the preferences window freezes. I have narrowed
>>> it down to an issue with GDK event filters, as it works properly when I remove
>>> the call to gdk_window_add_filter () here:
>>>
>>> https://github.com/adlocode/xfce4-lightdash-plugin/blob/master/src/lightdash-w
>>> indow-switcher.c#L1301
>>>
>>> I am not sure how to resolve this issue; does anyone have any ideas?
>>>
>>> Regards
>>>
>>> adlo
>>>
>>>
>>> _______________________________________________
>>> Xfce4-dev mailing list
>>> [hidden email]
>>> https://mail.xfce.org/mailman/listinfo/xfce4-dev
>> _______________________________________________
>> Xfce4-dev mailing list
>> [hidden email]
>> https://mail.xfce.org/mailman/listinfo/xfce4-dev
> _______________________________________________
> Xfce4-dev mailing list
> [hidden email]
> https://mail.xfce.org/mailman/listinfo/xfce4-dev



--
Ricardo Biehl Pasquali
_______________________________________________
Xfce4-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce4-dev
Reply | Threaded
Open this post in threaded view
|

Re: lightdash: Preferences window freezes after opening dashboard

adlo
> On 8 Sep 2015, at 13:55, Ricardo Biehl <[hidden email]> wrote:
>
> I think you should return 'GDK_FILTER_REMOVE'.

Actually, it seems that if I return GDK_FILTER_CONTINUE, it works correctly, but if I return GDK_FILTER_REMOVE, the preferences window freezes as before. Why is this?

Regards

adlo
_______________________________________________
Xfce4-dev mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce4-dev