Commit Graph

191 Commits

Author SHA1 Message Date
Chris Michael 57a3a62981 When we try to re-enable a monitor, check the Crtc Mode (not the smart
object Current mode) to determine if it is already disabled.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 08:57:57 +01:00
Chris Michael a39246c312 Remove return value in function returning void.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-02 11:36:07 +01:00
Chris Michael 9046a6b6f0 Add function to allow disable/enable of the indicator toggle.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-02 11:07:52 +01:00
Chris Michael 3f2e850259 Big giant Monitor Snapping Fix when we resize or move !! ;)
- Add previous monitor geometry to smart data structure.
- When we set the crtc, also set the monitor current geometry.
- Add function to return the previous monitor geometry.
- On a mouse up, check for monitor location difference versus previous
geometry, if nothing changed then we have no 'move' to do.
- When we start a resize, record the previous geometry and raise the
monitor.
- When a monitor is moved/resized we call the position_update function
which already loops all monitors, so no need to loop them twice.
- Fix position_update function to allow some Snapping Fuzziness so
that on a move/resize any adjoining monitors (within tolerance) will
more reliably snap to each other.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-01 08:25:09 +01:00
Chris Michael 7f6285d9fd When we are re-enabling a monitor, do not free the mode info from the
smart data's list of modes. This will get freed when the dialog closes.

Fix some formatting for 80 columns.

NB: Should fix etrunko crash ;)

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-07-26 16:36:52 +01:00
Chris Michael 0537494ba7 Fix issue of incorrect x/y position being displayed on a monitor after
snapping.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-28 11:03:26 +01:00
Chris Michael b4f277a4a6 When we free outputs, set the variable to NULL.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-27 10:57:22 +01:00
Chris Michael bba201a892 If a monitor is disabled by the user, then we need to set number of
outputs to zero, and free any allocated outputs before trying to apply
settings.

Also, check for valid mode (not 0) before trying to fetch mode_info.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-27 07:39:23 +01:00
Mike Blumenkrantz 0dd2efa30f ensure randr dialog clears its pointer stack 2013-06-24 10:56:21 +01:00
Chris Michael ee715e2472 Fix possible memory leak reported by klockwork.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-05-29 13:05:43 +01:00
Chris Michael 1b76632915 Add suport for setting the Primary Output in the randr dialog....for
my German friend ;)

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-05-24 13:05:41 +01:00
Chris Michael d6a392d127 Preliminary support for Primary Output of XRandR
NB: If you have more than one output, XRandR has the option/support to
set a specific monitor as the primary output. These changes allow some
distinction in the dialog between which output is primary (a faint
glow around the monitor). This is just the "display" portion of
Primary Output support ... next is a method to Change that.

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-05-24 11:28:34 +01:00
Chris Michael 10acf59475 Fix potential memleaks reported by klockwork.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-05-20 10:31:01 +01:00
Chris Michael 37498d7062 Add function to find a valid crtc for this monitor if none is set.
If a monitor gets re-enabled and no current mode is set (which is
typically the case), then find a mode based on size.

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-05-19 12:44:26 +01:00
Chris Michael 31d34db673 Initialize 'orients' variable to rotation 0.
Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-05-19 12:44:26 +01:00
Chris Michael 1197cc43a9 Minor formatting fix.
Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-05-18 16:35:16 +01:00
Christopher Michael eca3475b79 Fix incorrect monitor position text on some startup cases.
When we call "grid_set" (as a result of the grid object moving or
resizing), we should update the monitor position text.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>
2013-02-27 12:01:25 +00:00
Christopher Michael dce3e8f74f Skip refresh rate checks during resize.
Some people have reported that resizing is difficult, or that they
could not get to the max resolution of their monitor(s). Skipping the
refresh rate check during resolution finding fixes that ... With a big
fat Gotcha !!! because now after changing resolutions, the refresh
rate May not match what was previously selected....

So, as a word of CAUTION: After you set a resolution you should now
Verify your Refresh Rate before Applying, else you may be getting an
undesirable rate :/

Signed-off-by: Christopher Michael <cp.michael@samsung.com>
2013-02-26 11:09:45 +00:00
Christopher Michael c3736db94f Add a monitor_resized callback so positions of other monitors can be
updated.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84233
2013-02-19 11:01:29 +00:00
Christopher Michael 8109e62825 When we do a current_geometry set, repack the monitor to the updated
geometry.
Add a geometry_get function for monitor.
Fix up cloning code to work properly with different size
parents/children.
Add a monitor_clone_parent_get function.
When applying changes, also use crtc_clone_set function.
Add smart callback for monitor_moved to tell randr widget it may need
to shuffle things around.
Use output mouse position, not canvas position.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84228
2013-02-19 11:01:14 +00:00
Christopher Michael 686ff23a54 Add some comments.
Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84219
2013-02-19 11:00:09 +00:00
Christopher Michael 0ac5ed720a Handle apply of monitor changes to X.
Reduce position text set calls and just do it on smart_move.
Add a changes_apply function.
Add code to record changes to a monitor.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84217
2013-02-19 10:59:58 +00:00
Christopher Michael 994586d509 Add code to handle when cloning monitors so that the size, mode and
orient of each will match (NB: This is required by XRandR in order for
cloning to be successful).

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84212
2013-02-19 10:59:44 +00:00
Christopher Michael 6739bcfe66 Add the clone object as a smart member for monitor.
Add some comments.
Update position and resolution text when we unclone.
Repack the monitor into the grid when we unclone.
Set virtual thumb size correctly.
Emit disabled signal (if needed) when we unclone.
Also record x/y coordinates when doing move/resize/rotate.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84210
2013-02-19 10:59:38 +00:00
Christopher Michael fee5a89bfa Add cloning support for monitor.
Tie in code for indicator toggle (enable/disable).
Add function to return a monitor's crtc id (used in randr widget).

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84207
2013-02-19 10:59:30 +00:00
Christopher Michael 5f68828189 Simplify the monitor rotation code and make sure new positions are
within grid virtual space.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84203
2013-02-19 10:59:20 +00:00
Christopher Michael 1d10a382b6 Actually, allow move/resize/rotate for disabled monitors so things can
be adjusted (NB: Will not actually mattery on Apply anyway).

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84197
2013-02-19 10:59:03 +00:00
Christopher Michael c5254ce545 Set current size and position text when we set current values.
Add function for setting current geometry.
If a monitor is disabled, do not allow rotate, resize, move events.
Fix resize start/stop functions to use current geometry.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84196
2013-02-19 10:59:00 +00:00
Christopher Michael f48772482c Fix move_stop to use current geometry.
Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84194
2013-02-19 10:58:54 +00:00
Christopher Michael 2819733656 Handle setting monitor to enabled/disabled based on crtc mode.
Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84193
2013-02-19 10:58:51 +00:00
Christopher Michael 2acdd3f3e2 Add 'current' field values so we can use these durring apply for
comparison to old values.
Fix move, resize, rotate code to use "current" values.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84191
2013-02-19 10:58:45 +00:00
Christopher Michael aee6393591 Add code to handle manual monitor movement.
Fix up coordinate functions to not need doubles.
Update monitor position text when moving.
Fix up rotation code to allow rotating when mouse is outside the frame
(thank you Daniel) ;)

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84190
2013-02-19 10:58:42 +00:00
Christopher Michael b33401f645 Add in refresh_rate code for filling refresh rate list and listening
for changes.
Break map_apply function into frame_map_apply and thumb_map_apply for
rotating just the wallpaper.
Fix resize code to work with a rotated monitor.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84188
2013-02-19 10:58:36 +00:00
Christopher Michael 39bc25be03 Use ecore_x_randr_crtc_info_free function to free returned crtc_info.
When comparing refresh rates for mode searches, cast to int.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84187
2013-02-19 10:58:33 +00:00
Christopher Michael 2e0f4e7a27 Reduce variable usage
Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84186
2013-02-19 10:58:31 +00:00
Christopher Michael e02c9fc7aa Fix comment.
Remove orientation comparison.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84185
2013-02-19 10:58:28 +00:00
Christopher Michael af59660d3f Add ROTATE_FUZZ amount.
Add inline function to get orientation based on rotation amount.
Add function to apply an evas_map for rotation.
If we are rotating, we don't need to set livethumb size.
When we start rotating, set initial rotation amount to 0.
When rotation stops, update the map and monitor position where needed.
Apply map during rotation.

NB: This commit also adds a debugging red rectangle behind the
monitor. This will be removed when debugging is complete

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84184
2013-02-19 10:58:25 +00:00
Christopher Michael c2b2be5be7 Add current rotation to smart_data structure.
Fill in current rotation on crtc set.
Update current rotation when we get a rotation event.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84183
2013-02-19 10:58:22 +00:00
Christopher Michael 35855135a1 Add inline function to return the degree of rotation based on
orientation.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84182
2013-02-19 10:58:19 +00:00
Christopher Michael 87daec404d Remove Big Fat Fixme warning as it's fixed now :)
Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84181
2013-02-19 10:58:16 +00:00
Christopher Michael ed84b96078 Add code to check EFL version.
If we are using a newer version, then we can use the new
ecore_x_randr_crtc_info_get() function which will save us a lot of X
round-trips.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84180
2013-02-19 10:58:13 +00:00
Christopher Michael 93ad1faf50 Add current mode and refresh rate to crtc field.
Add function prototype for getting a mode refresh rate.
Add Big Fat FIXME for crtc_set function.
Get the crtc current mode & refresh rate when crtc is set.
Simplify monitor_mode_find function.
Add function for getting a mode refresh rate.
Start on rotation event code.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84179
2013-02-19 10:58:10 +00:00
Christopher Michael 1ec01f9d65 Add function to get the amount of rotation from a mouse event.
Simplify mouse movement check in resize_event and add some better
comments.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84178
2013-02-19 10:58:06 +00:00
Christopher Michael 3526741c82 Turn 'crtc' field into a structure (mainly for making code easier to
read/maintain).

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84177
2013-02-19 10:58:04 +00:00
Christopher Michael 5b47415f14 Add code to check if rotations for a given crtc are possible, and
disable the rotation in edje if not.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84176
2013-02-19 10:58:01 +00:00
Christopher Michael 9edea3c781 Only get edid (an expensive process) if getting the output name
previously has failed.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84175
2013-02-19 10:57:57 +00:00
Christopher Michael 7abc8a7aca Add flag for rotating to structure.
Add & delete callbacks for rotation start & stop.
Add functions for rotate start & stop.
Add start of rotate event code.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84174
2013-02-19 10:57:55 +00:00
Christopher Michael 2edc7cfeaf Add some comments.
Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84173
2013-02-19 10:57:52 +00:00
Christopher Michael 480170d4ce Remove all code which tried to maintain aspect ratio of the frame
(resize snapping to mode dimensions will handle this anyway).

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84172
2013-02-19 10:57:50 +00:00
Christopher Michael bda3e4bcdc Change structure to store grid geometry.
Change grid_set function to accept grid geometry.
Add monitor_virtual_size_set function.
Only update livethumb preview size if we are not manually resizing.
Don't need to set the resolution text during smart_resize.
Add functions to convert coordinates to/from virtual to canvas.
Add function to find the closest randr mode to a given size.
Add function to handle user manual resizing.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84170
2013-02-19 10:57:44 +00:00