← Back to team overview

xpad-hackers team mailing list archive

Usability: toggle window decorations by mouse-over or click

 

Hi there!

Great little app, I've tried a few smaller toys, and biggers, like Tomboy,
but ended up with XPad.
I love how this one takes being a sticky notes app seriously and lets me
tweak its UI to minimize redundant clutter.

One itch I solved for myself, and might interest others, too:

In "stealth" mode (decorations off) you may still want to resize, move,
rollup a note etc., but to dig down in a menu to turn decorations back on
(and then off again) is much more tedious than the action itself.

Automatically switching the decorations temporarily on when "touching" a
note, and then back off when finished, would be more intuitive and
comfortable.

Now, as a complete newbie at X (but an experienced C/C++ developer
elsewhere), I couldn't find a simple way to do this (within the ~30 minutes
I was willing to give it) using the enter/leave signals. (E.g. a) on my
XFCE4 a left button press seems to also induce a later "leave",
inadvertently losing the decorations on a click; but more importantly: b)
"leave" fires when leaving the "client" area (please excuse my Win32 lingo
;) ), so the decorations are removed just before the pointer could reach
them. :) ) Perhaps enter/leave could still be used somehow, but I didn't
investigate further (and didn't want to mess with a delay timer).

As a fallback, one can also toggle the decorations by clicking on a note.
Still quite minimally intrusive, and very easy to implement.

Adding these lines

   static gboolean last_decoration_state = FALSE; // fine default for
"decorations off"

   if (!xpad_settings_get_has_decorations (xpad_settings ()))
   {
      last_decoration_state = last_decoration_state ? FALSE : TRUE;
      gtk_window_set_decorated (GTK_WINDOW(pad), last_decoration_state);
   }

to the beginning of xpad_pad_text_view_button_press_event(...) looks (and
works) OK.

Questions:

1. Any platform-specific reason (threading, GTK, conventions, whatnot)
against a function-static var here?
2. What's the preferred procedure to put stuff like this to the codebase?
3. ...and then pushing it to Debian?

Thanks 1000000 & have a nice time,
lunakid