Commit graph

70 commits

Author SHA1 Message Date
Federico Mena Quintero
5180a99017 Merge branch 'randr-set-as-default'
This adds a "Make Default" button in gnome-display-properties, which is used
to set up a systemwide default RANDR configuration.  For users which don't have
a personal ~/.config/monitors.xml, then that systemwide configuration will
be used instead.

There is a PolicyKit helper program, gnome-display-properties-install-systemwide,
which is used to create the file

  /etc/gnome-settings-daemon/xrandr/monitors.xml

in a secure fashion.
2010-04-06 18:31:22 -05:00
Federico Mena Quintero
c30ff27d1f Show a success dialog when the configuration is saved
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-03-19 16:44:01 -06:00
Federico Mena Quintero
518b887937 Actually call pkexec(1) to set the systemwide configuration
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-03-19 16:02:58 -06:00
Federico Mena Quintero
1665cdbed5 RANDR - Don't show a tooltip while a monitor is being dragged
Otherwise the tooltip obscures what you are dragging.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-03-17 18:44:30 -06:00
Federico Mena Quintero
eaa7342a04 Factor out function to sanitize and save the RANDR configuration
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-03-10 12:33:51 -06:00
Federico Mena Quintero
8c7020b832 Add a 'Make Default' button
This button will use a PolicyKit helper to save the display configuration
to a systemwide file.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-03-10 12:29:09 -06:00
Federico Mena Quintero
bbb7a64c2a Add a tooltip about how to select/drag the monitors
Now that the label with instructions is gone, let's have
a tooltip with better instructions.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-02-17 17:17:17 -06:00
Federico Mena Quintero
188d5bfefb Use a cross-with-arrows instead of a hand for the cursor
Cross-with-arrows means 'you can move me', while hand means 'you can click me'
in this day and age.  Pointed out by Ka-Hing Cheung <kahing@gmail.com>

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-02-16 17:22:07 -06:00
Federico Mena Quintero
b06684e157 Remove hack to shrink the FooScrollArea if the screen is too small
The new window fits in 640x480 without any adjustments to the size of the
FooScrollArea, so we don't need to adjust that size anymore.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-02-12 13:55:19 -06:00
Federico Mena Quintero
d43cb0cd8c Set the mouse cursor to a hand when an output is draggable
This should make it more obvious that outputs are in fact draggable
in the FooScrollArea, and it will let us remove the ugly label
with instructions for how to drag the monitors.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-02-12 13:28:39 -06:00
Federico Mena Quintero
d271671798 Make the display capplet's window fit in 800x600 displays
We simply hack the FooScrollArea for the monitor display to be shorter.
We can get fancier in the future by really computing the size based
on the monitor into which the window eventually gets mapped.

Patch by Takashi Iwai <tiwai@novell.com> - https://bugzilla.novell.com/show_bug.cgi?id=564579

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-02-11 17:32:37 -06:00
Federico Mena Quintero
a3aa98b49a RANDR - Show 'Mirror Screens' in the monitor label, not a random monitor's name
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-12-11 12:49:04 -06:00
Federico Mena Quintero
0f0e35d509 RANDR - Desensitize the on/off radio buttons if we are in Mirror Screens mode
This makes it even more obvious that you don't need to turn on
individual outputs for Mirror Screens to work properly.

It also means that we don't support "combined" setups like two mirrored
screens and one extended screen.  It seems that the majority of people only care about a few cases:

  - Laptop plus projector or monitor showing the same thing.
  - Computer plus secondary monitor(s) with an extended desktop.
  - Laptop plus docking station with external monitor only (built-in LCD turned off).

For more exotic combinations, people can use the xrandr(1) tool.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-12-11 12:49:03 -06:00
Federico Mena Quintero
32cd3a9d39 RANDR - Sensitize 'Mirror Screens' depending on whether mirror mode is actually supported
Previously it was always sensitive, even if there were not enough connected outputs
for mirroring, or if those those outputs didn't support the same resolution for
mirroring.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-12-11 12:49:03 -06:00
Federico Mena Quintero
6d40eb2648 bgo#590823 - RANDR - Automatically turn on outputs which support Mirror Screens
Previously, outputs could remain off if the user just selected Mirror Screens.
Now we automatically turn on all the outputs which support the clone mode,
to avoid extra work on the part of the user.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-12-11 12:45:17 -06:00
Matthias Clasen
5ebf7c1c51 bgo#593866 - Don't assert when the current output doesn't have a resolution set yet
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-10-19 13:57:27 -05:00
Matthias Clasen
579e1f8690 Fix dragging of rotate monitors
We were using the rotated geometry for drawing, but the unrotated
geometry for snapping. Reported in bug 578109.
2009-08-20 17:16:33 -04:00
Federico Mena Quintero
5d9f7b5e2a RANDR - ensure that the output labels fit inside the monitor rectangles
The labels would get clipped if the monitor rectangles were too small,
thus making the labels unreadable.  Now we ensure that the ink_rect of
the text fits, and we center the text based on its logical_rect.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-06 15:33:22 -05:00
Federico Mena Quintero
e2a0d731ac RANDR - remove dead code
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-06 15:33:22 -05:00
Federico Mena Quintero
04d2ad2b45 RANDR - Don't sort the outputs before creating the labeler
We used to sort the outputs by their X coordinate, maybe to display a list of them in a
reasonable order.  However, we don't display such a list at all, so it doesn't make
sense to sort the outputs.  This also makes the capplet use the same ordering for outputs
as gnome-settings-daemon for GnomeRRLabeler's purposes, so that the colors for the outputs
match in both the capplet and g-s-d.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-08-06 15:33:22 -05:00
Claude Paroz
8c225e772d Remove markup from translatable string. Fixes #590933 2009-08-06 18:04:36 +02:00
Federico Mena Quintero
8fc5964b82 RANDR - Don't realign outputs if the current output didn't change resolutions
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-07-16 12:19:53 -05:00
Federico Mena Quintero
bba301ff9c RANDR - Factor out function to generate strings for refresh rate like '60 Hz'
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-07-16 12:19:52 -05:00
Federico Mena Quintero
dc62815db2 RANDR - when turning an output on, default to its preferred resolution
Previously we were picking the output's highest-supported resolution, which is not
always the same as its preferred resolution.  We also do this while actually turning
the output on, not as a side effect of rebuilding the resolution combo.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-07-16 12:19:52 -05:00
Federico Mena Quintero
9516f2f082 RANDR - Factor out function to generate strings for resolution like 'width x height'
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-07-16 12:19:52 -05:00
Felix Riemann
622a730e5c [display] Remove libglade dependency from display-properties capplet 2009-07-09 14:54:25 +02:00
Federico Mena Quintero
4aac93ce2d randr - Don't pop up a redundant error dialog
In case the RANDR configuration cannot be applied, gnome-settings-daemon already
pops up an error message.  So, don't pop up another error of our own.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-15 15:11:01 -05:00
Federico Mena Quintero
74e06ac80e Use the timestamp of the Apply button to change the RANDR configuration
There is no timestamp available when the dialog returns from gtk_dialog_run().
So, we save the timestamp at the time the Apply button is clicked.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-08 20:17:38 -05:00
Federico Mena Quintero
9281a911cf Fix the layout-outputs-horizontally helper
The horizontal coordinate was not always being updated.
Also, ensure that outputs are at y=0.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-08 20:06:20 -05:00
Federico Mena Quintero
af03baa1bc bgo#556050 - Make the monitor heading in the RANDR capplet be explicitly black
The labels are always painted against a light pastel background.  Using
the theme's colors makes the label hard to read on 'inverse' themes.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-05-06 14:03:40 -05:00
Federico Mena Quintero
72ed4d4460 bnc486093 (RANDR) - Ensure that there will be a backup file before committing changes
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9398
2009-03-31 01:56:27 +00:00
Federico Mena Quintero
4ec217c6b2 (RANDR) - Simplify calls to dbus-glib which cannot fail; remove two unneeded/cryptic error messages.
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9382
2009-03-20 18:51:48 +00:00
Federico Mena Quintero
6ea3c02290 bgo576006 (RANDR) - Pass a transient parent id to the ApplyConfiguration call from gnome-settings-daemon,
so that it can make its confirmation window a child of the parent.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9376
2009-03-19 23:48:58 +00:00
Federico Mena Quintero
38de654eea bgo574865 (RANDR) - Don't leave a dangling pointer for the current_output when the RANDR configuration changes
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9339
2009-03-11 15:14:11 +00:00
Gabor Kelemen
4cd96a9881 Make the strings of the Rotation dialog appear translated. Bug #574693.
2009-03-11  Gabor Kelemen  <kelemeng@gnome.hu>

	* xrandr-capplet.c: Make the strings of the Rotation dialog appear
	translated. Bug #574693.

svn path=/trunk/; revision=9336
2009-03-11 09:48:27 +00:00
Jens Granseuer
1264bf2940 GTK_DIALOG_NO_SEPARATOR cannot be used with GtkMessageDialog
2009-02-21  Jens Granseuer  <jensgr@gmx.net>

	* xrandr-capplet.c: (error_message): GTK_DIALOG_NO_SEPARATOR cannot be
	used with GtkMessageDialog

svn path=/trunk/; revision=9281
2009-02-20 23:17:07 +00:00
Federico Mena Quintero
83fc72127e RANDR - Make the color of monitor labels consistent with the per-monitor popups
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9278
2009-02-20 00:49:01 +00:00
Federico Mena Quintero
df57fe082a bnc472226 (RANDR) - Use an async D-bus call to avoid blocking the GUI while gnome-settings-daemon changes the RANDR parameters
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9242
2009-02-05 21:20:54 +00:00
Federico Mena Quintero
5e0e21f11e bnc472226 (RANDR) - Put the D-bus connection and proxy in the main App structure, not in local variables.
We'll need this to maintain state for the D-bus async callback.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9241
2009-02-05 21:20:40 +00:00
Federico Mena Quintero
876e2efa5e bnc434729 (RANDR) - Realign the outputs after changing the resolution of one of them
2009-02-04  Federico Mena Quintero  <federico@novell.com>

	https://bugzilla.novell.com/show_bug.cgi?id=434729 - Realign the
	outputs when changing the resolution of one of them, so one
	doesn't get overlapping monitors (when the resolution becomes
	bigger) or disjoint monitors (when the resolution becomes smaller).

	* xrandr-capplet.c (on_resolution_changed): Align the monitors.
	(realign_outputs_after_resolution_change): New function.  The
	algorithm here could certainly be improved...

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9238
2009-02-04 22:59:50 +00:00
Jens Granseuer
7c1b15bed6 don't crash if we don't have an output (bug #569218)
2009-01-26  Jens Granseuer  <jensgr@gmx.net>

	* xrandr-capplet.c: (rebuild_rate_combo),
	(rebuild_resolution_combo): don't crash if we don't have an output
	(bug #569218)

svn path=/trunk/; revision=9210
2009-01-26 21:37:27 +00:00
Federico Mena Quintero
ea6b78e870 Desensitize the Resolution combo when the output is off
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9189
2009-01-07 23:28:46 +00:00
Federico Mena Quintero
53f721544d Let the user turn on outputs which were off
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9188
2009-01-07 23:28:25 +00:00
Federico Mena Quintero
262658abc5 Don't re-select the current output when flipping workspaces
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9187
2009-01-07 23:28:08 +00:00
Federico Mena Quintero
fabb6bd6dc bnc433939 - Add On/Off radio buttons for the monitors
2008-12-18  Federico Mena Quintero  <federico@novell.com>

	https://bugzilla.novell.com/show_bug.cgi?id=433939 - It's not
	obvious how to turn on a new monitor.

	* display-capplet.glade: Add On/Off radio buttons for the selected
	monitor, as it is hard to find that the on/off state is actually
	set by the Resolution combo.

	* xrandr-capplet.c (rebuild_gui): Don't set sensitivity of
	resolution_combo here...
	(rebuild_resolution_combo): ... but do it here instead.  This is
	so that we can match the state of the monitor on/off buttons.
	(rebuild_on_off_radios): New function.  We set the on/off radio
	buttons based on the "on" state of the current output.
	(monitor_on_off_toggled_cb): New callback; we toggle the current
	output's on/off state.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9186
2009-01-07 23:27:49 +00:00
Federico Mena Quintero
23f974558f Fix a variable type
2008-12-18  Federico Mena Quintero  <federico@novell.com>

	* xrandr-capplet.c (select_current_output_from_dialog_position):
	Fix the type of the "output" variable.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9185
2009-01-07 23:27:30 +00:00
Federico Mena Quintero
1394953ef6 bnc450141 - Hide the Help button in the display capplet, as it does nothing
2008-12-16  Federico Mena Quintero  <federico@novell.com>

	https://bugzilla.novell.com/show_bug.cgi?id=450141 - Help button
	in the Display capplet does nothing.

	* xrandr-capplet.c (run_application): Hide the Help button as we
	have no help to show for this capplet yet.
	(hide_help_button): New function.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9176
2008-12-18 19:09:21 +00:00
Frederic Peters
34f643bb92 Declare variable, fix build.
* xrandr-capplet.c: (select_current_output_from_dialog_position):
Declare variable, fix build.


svn path=/trunk/; revision=9172
2008-12-16 11:40:36 +00:00
Federico Mena Quintero
e16c9d3715 Don't duplicate code to pick the current output
2008-12-15  Federico Mena Quintero  <federico@novell.com>

	* xrandr-capplet.c (on_screen_changed): Use
	select_current_output_from_dialog_position() instead of selecting
	an output ourselves.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9171
2008-12-15 23:19:32 +00:00
Federico Mena Quintero
3545215c21 Select the RANDR output which contains the configuration window
2008-12-15  Federico Mena Quintero  <federico@novell.com>

	* xrandr-capplet.c (select_current_output_from_dialog_position):
	New function.
	(dialog_map_event_cb): New GtkWidget::map-event handler for the
	toplevel dialog.  When the dialog gets mapped, we make the current
	output be the one which actually contains the dialog window, so
	that the user can edit the monitor which he's looking at.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=9170
2008-12-15 23:19:16 +00:00