Merge lp://qastaging/~dandrader/compiz/resize_vert_max into lp://qastaging/compiz/0.9.8
Proposed by
Daniel d'Andrada
Status: | Merged |
---|---|
Approved by: | Daniel d'Andrada |
Approved revision: | 3317 |
Merged at revision: | 3314 |
Proposed branch: | lp://qastaging/~dandrader/compiz/resize_vert_max |
Merge into: | lp://qastaging/compiz/0.9.8 |
Diff against target: |
5764 lines (+3832/-1599) 31 files modified
plugins/resize/CMakeLists.txt (+4/-1) plugins/resize/resize.xml.in (+5/-0) plugins/resize/src/composite-screen-impl.h (+70/-0) plugins/resize/src/composite-window-impl.h (+63/-0) plugins/resize/src/gl-screen-impl.h (+65/-0) plugins/resize/src/gl-window-impl.h (+62/-0) plugins/resize/src/logic/CMakeLists.txt (+41/-0) plugins/resize/src/logic/include/composite-screen-interface.h (+42/-0) plugins/resize/src/logic/include/composite-window-interface.h (+41/-0) plugins/resize/src/logic/include/gl-screen-interface.h (+41/-0) plugins/resize/src/logic/include/gl-window-interface.h (+41/-0) plugins/resize/src/logic/include/property-writer-interface.h (+46/-0) plugins/resize/src/logic/include/resize-defs.h (+42/-0) plugins/resize/src/logic/include/resize-logic.h (+181/-0) plugins/resize/src/logic/include/resize-window-interface.h (+41/-0) plugins/resize/src/logic/include/screen-interface.h (+70/-0) plugins/resize/src/logic/include/window-interface.h (+88/-0) plugins/resize/src/logic/src/resize-logic.cpp (+1679/-0) plugins/resize/src/logic/tests/CMakeLists.txt (+27/-0) plugins/resize/src/logic/tests/fake-property-writer.h (+66/-0) plugins/resize/src/logic/tests/mock-screen.h (+71/-0) plugins/resize/src/logic/tests/mock-window.h (+87/-0) plugins/resize/src/logic/tests/resize-options-mock.cpp (+49/-0) plugins/resize/src/logic/tests/test-logic.cpp (+295/-0) plugins/resize/src/logic/tests/x11-mocks.cpp (+36/-0) plugins/resize/src/property-writer-impl.h (+71/-0) plugins/resize/src/resize-window-impl.h (+66/-0) plugins/resize/src/resize.cpp (+83/-1511) plugins/resize/src/resize.h (+3/-87) plugins/resize/src/screen-impl.h (+128/-0) plugins/resize/src/window-impl.h (+228/-0) |
To merge this branch: | bzr merge lp://qastaging/~dandrader/compiz/resize_vert_max |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sam Spilsbury | Approve | ||
Daniel van Vugt | Needs Information | ||
Review via email:
|
Commit message
Maximize vertically if pointer reaches top or bottom edges.
For now there's no animation. That will be done later once the new designs for resizing and half/full screen maximizations (grid plugin) are implemented.
Includes a refactoring to make to make the code testable and another that splits a huge method into smaller functions.
Description of the change
Maximize vertically if pointer reaches top or bottom edges.
For now there's no animation. That will be done later once the new designs for resizing and half/full screen maximizations (grid plugin) are implemented.
To post a comment you must log in.
Looks great, thanks for splitting up handleMotionEvent such that its more like a template function now - the code is much more readable.
The pedantic stuff:
* 5 can be replaced with a magic number
1000 + if (grabWindowWork Area->bottom( ) - yRoot <= 5 vertically)
1001 + && !maximized_
vs
985 + if (yRoot - grabWindowWorkA rea->top( ) <= max_edge_distance vertically)
986 + && !maximized_
* max_edge_distance can be made const. VertMax; vertically;
* I'm not sure why max_geometry is an XRectangle, it can probably be a CompRect.
* Prefer camel case variable names to underscored ones, eg fooBar not foo_bar.
* Slight style issues, please add a space between the item and the bracket, eg foo () not foo()
* 1071 + XRectangle geometryWithout
1072 + bool maximized_
- I *think* maximized_ vertically is indented incorrectly here, its one tab and not 8 spaces.
* Quick info on our indentation style as its almost impossible to get right unless through muscle memory :( [X11 style, and no, its not changing]
: 1 indent, 4 spaces.
: 2 indents, 1 tab,
: 3 indents, 1 tab, 4 spaces
: 4 indents, 2 tabs etc
* This is very strange, as you seem to have gotten the indentation scheme right on the function that you added, (enableOrDisabl eVerticalMaximi zation) , however your editor seems to have screwed up the bits that that were refactored, so if you can autocorrect it to the correct indentation scheme that would be great.
More important: CompScreen and my code by using interfaces
* No tests, and I don't like merging code that doesn't have tests. Sorry :( . Unfortunately, compiz code is made more annoying to test by the fact that we have several objects in core that are not instantiable in a test harness. Also its not possible to link to plugins. Generally speaking I get around this in two ways:
- break the dependencies of between CompWindow/
- split out the thing one wants to test into a separate static library and link to that
Fortunately I've had to do this enough times that there are a couple of examples littered around the source tree, see wall, composite, decor, place Maximization under test, the rest is just cut'n'pasted refactoring where signatures are preserved
* I think we only need to worry about getting enableOrDisable
* I have a bit of concern that this code doesn't entirely belong here, it would probably belong in the bit of unity/somewhere else where we actually deliver this feature. However, in case we don't manage to deliver the complete feature on time, having it here is good enough, and getting it under test has the added bonus of making it portable enough so that we can move it around if need be.