Skip to content

Commit

Permalink
Workaround vala bugzilla 618217.
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwoodman committed May 10, 2010
1 parent 4f2a2ab commit a0b4a30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
16 changes: 10 additions & 6 deletions globalmenu-plugin/agent.vala
Original file line number Diff line number Diff line change
Expand Up @@ -233,28 +233,32 @@ internal class MenuBarAgent {
void* pointer = &xevent;
return real_event_filter((X.Event*) pointer, event);
}
private bool atom_equal(Gdk.Atom a1, Gdk.Atom a2) {
if(&a1 == &a2) return true;
return false;
}
[CCode (instance_pos = -1)]
private Gdk.FilterReturn real_event_filter(X.Event* xevent, Gdk.Event event) {
switch(xevent->type) {
case X.EventType.PropertyNotify:
Gdk.Atom atom = Gdk.x11_xatom_to_atom(xevent->xproperty.atom);
if(!(atom_select == atom)
&& !(atom_deselect == atom)
&& !(atom_activate == atom))
if(!atom_equal(atom_select, atom)
&& !atom_equal(atom_deselect, atom)
&& !atom_equal(atom_activate, atom))
break;
var path = get_by_atom(atom);
var item = Locator.locate(menubar, path);
if(item == null) {
warning("item not found. path=%s", path);
break;
}
if(atom_select == atom) {
if(!atom_equal(atom_select, atom)) {
select_item(item);
}
if(atom_deselect == atom) {
if(!atom_equal(atom_deselect, atom)) {
deselect_item(item);
}
if(atom_activate == atom) {
if(!atom_equal(atom_activate, atom)) {
activate_item(item);
}
break;
Expand Down
5 changes: 4 additions & 1 deletion libsettings/settings.vala
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ public class Gnomenu.Settings : Object {
void * pointer = &xevent;
return real_event_filter((X.Event*)pointer, event);
}
private bool atom_equal(Gdk.Atom a1, Gdk.Atom a2) {
return &a1 == &a2;
}
[CCode (instance_pos = -1)]
private Gdk.FilterReturn real_event_filter(X.Event* xevent, Gdk.Event event) {
Gdk.Atom atom_in = Gdk.x11_xatom_to_atom(xevent->xproperty.atom);
switch(xevent->type) {
case X.EventType.PropertyNotify:
if(atom == atom_in) {
if(atom_equal(atom, atom_in)) {
pull();
}
break;
Expand Down

0 comments on commit a0b4a30

Please sign in to comment.