Source code is /* no icons on the desktop, grab the focus and pop up the menu */ if(!gtk_widget_has_grab(w)) gtk_grab_add(w); xfce_desktop_popup_root_menu(desktop, button, evt->time); return TRUE; maybe better code /* no icons on the desktop, grab the focus and pop up the menu */ if(!gtk_widget_has_grab(w)) { gtk_grab_add(w); xfce_desktop_popup_root_menu(desktop, button, evt->time); return TRUE; }
Thanks for the report. Which xfdesktop version is that? https://git.xfce.org/xfce/xfdesktop/commit/?id=b94027ad3c0e74cebdd28c586d0d361a7d8ecb97
Latest released version, aka 4.12.5. Should the comment just above be updated to more accurately document what the code is doing ?
How would you change the comment? This is 4.13 (git master): https://git.xfce.org/xfce/xfdesktop/tree/src/xfce-desktop.c#n1318
From: /* no icons on the desktop, grab the focus and pop up the menu */ if(!gtk_widget_has_grab(w)) gtk_grab_add(w); xfce_desktop_popup_root_menu(desktop, button, evt->time); return TRUE; to: /* if no icons on the desktop then grab the focus */ if(!gtk_widget_has_grab(w)) gtk_grab_add(w); /* pop up the menu */ xfce_desktop_popup_root_menu(desktop, button, evt->time); return TRUE; No user visible change, but the comments and the code now match up.
The proposed comment actually is more confusing, it's near an if but the condition (no icons on the desktop) is evaluated by the macro. I think the current comment refers to the whole block (from endif to return), not perfect but correct.
Andre Miranda referenced this bugreport in commit 973df9fe472f9370c6e8c30d2e65553245993455 Fix indentation (Bug #15553) https://git.xfce.org/xfce/xfdesktop/commit?id=973df9fe472f9370c6e8c30d2e65553245993455