But in my case, the area is not really empty.  It's Oxygen that thinks
it is.  I guess a picture is worth a thousand words, so take a look at this:

    http://i52.tinypic.com/6r0fp4.png

The window can be dragged in the lower part of the star field (below the
"press any key" text).  This shouldn't be possible.



Hello Nikos,

Thanks for the screenshot.
You are correct that oxygen can't detect this by itself. For instance in "desktop settings->MouseAction", the main widget is actually the exact same "empty" scrollarea as yours, is dragable, and I believe it should be.

Now, if it were up to me, I would not mind being able to drag your window by clicking on the stars (I for instance like the fact that you can drag kpat from any place which is not a card. Same for kreversi), but feel free to disagree (and I'm sure some others do).

So, to "fix" it to your liking, implementing the mousePressEvent for the scrollarea, and setting event->ignore() should work. Basically aside from a couple of exceptions, oxygen consider an area as empty, as soon as the top level widget -QMainWindow- gets a mouse-press event, which indicates that no child widget must have used it (hence -> empty).

If you point me to your code, I can help implement (provided that I can build and test it).

To Parker: same thing (I think). Grab mouseClick events, do not propagate to parent.

For the record, and as a last resort, I also added to oxygen a cusom QObject property that force disabling of the window dragging. Namely if you add:

  widget->setProperty( " _kde_no_window_grab", false );

you achieve the same results. It looks simpler but is really not satisfactory IMO. (notably it would not fix the issue with other styles that don't recognize the option e.g. bespin, qtcurve).

So the event grabbing method is the recommended way. Again, I'm ready to provide help when pointed to code, if there are issues with the implementation.

Cheers,

Hugo



Note that dragging in those areas shouldn't be possible to begin with.
"To begin with", Why so ? This feature was asked by several people,
already supported in other styles (bespin, qtcurve), accepted inside
kde, and added to oxygen since kde4.5. Also, it can be disabled in the
front page of "oxygen-settings".
Yes, it's a nice feature.  And I like it even :-)  It's just that I need
to control it in my application because it behaves a bit wrong.


So the question is: is there a way I can disable this for specific QWidgets?

If you wonder about the details of my situation: I use a QScrollArea to
display a QWidget (where I'm drawing stuff using custom painting).  When
the QWidget is small and doesn't yet fill the entire QScrollArea, the
not yet filled areas are "draggable".  When the QWidget expands and
covers these areas, window dragging stops working.

Again that's the expected behavior, that users, used to the feature
above, expect, since the not yet covered part of the scrolled area, is
considered empty.
Which in my case isn't empty :-)  There's no reason, from the user's
point of view, why dragging is possible below the text but not possible
above it.

Does this btw look more like a bug in Oxygen?  Should I report it?  To
me it looks more like it's behaving correctly, but one type of behavior
can't possibly fit all use cases out there, one of which happens to me mine.


Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe<<

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to