debian/changelog | 9 ++++++++ debian/control | 3 +- grandr.glade | 2 - src/callbacks.c | 59 ++++++++++++++++++++++++++++++++----------------------- src/grandr.c | 29 +++++++++++++-------------- src/grandr.h | 6 ++--- src/interface.c | 2 - 7 files changed, 65 insertions(+), 45 deletions(-)
New commits: commit aa3cc75d642d0a2b8fb9edf4e0af71b3ab5f660c Author: David Nusinow <[EMAIL PROTECTED]> Date: Wed Mar 26 19:54:17 2008 -0400 Fix a segfault when clicking on the monitor list. Thanks Ari Pollak for the patch. Closes: #445310 diff --git a/debian/changelog b/debian/changelog index f9cedb1..db02248 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ grandr (0.1+git20080326-1) unstable; urgency=low * New upstream pull with some minor fixes * Make the XSF the maintainer with me as uploader + * Fix a segfault when clicking on the monitor list. + Thanks Ari Pollak for the patch. Closes: #445310 - -- David Nusinow <[EMAIL PROTECTED]> Wed, 26 Mar 2008 19:33:47 -0400 + -- David Nusinow <[EMAIL PROTECTED]> Wed, 26 Mar 2008 19:52:16 -0400 grandr (0.1-3) unstable; urgency=low diff --git a/src/callbacks.c b/src/callbacks.c index f5a4bd4..d419e4f 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -159,8 +159,10 @@ on_modes_combo_changed (GtkComboBox *combobox, GtkTreeIter iter; int mode_id; + if (!gtk_combo_box_get_active_iter (combobox, &iter)) + return; model = gtk_combo_box_get_model (combobox); - gtk_combo_box_get_active_iter (combobox, &iter); + gtk_tree_model_get (model, &iter, COL_MODE_ID, &mode_id, -1); @@ -231,7 +233,7 @@ on_iview_drag_data_get (GtkWidget *widget, GtkTreeIter iter; GList *path_list; GtkTreePath *tree_path; - int output_id; + static int output_id; int i; GtkIconView *iconview = (GtkIconView *) widget; @@ -261,7 +263,7 @@ on_iview_drag_data_get (GtkWidget *widget, &output_id, sizeof (int) ); - gtk_list_store_remove (model, &iter); + gtk_list_store_remove (GTK_LIST_STORE(model), &iter); } @@ -289,9 +291,9 @@ on_iview_drag_data_received (GtkWidget *widget, output_id = (int) *data->data; output_name = get_output_name (screen_info, output_id); - store = gtk_icon_view_get_model (widget); - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + store = gtk_icon_view_get_model (GTK_ICON_VIEW(widget)); + gtk_list_store_append (GTK_LIST_STORE(store), &iter); + gtk_list_store_set (GTK_LIST_STORE(store), &iter, COL_OUTPUT_ID, output_id, COL_OUTPUT_NAME, output_name, COL_OUTPUT_PIXBUF, output_pixbuf, @@ -311,7 +313,7 @@ on_auto_cbtn_toggled (GtkToggleButton *togglebutton, if (gtk_toggle_button_get_active (togglebutton)) { gtk_widget_set_sensitive (mode_combo, FALSE); - gtk_toggle_button_set_active (off_cbtn, FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(off_cbtn), FALSE); screen_info->cur_output->auto_set = 1; screen_info->cur_output->off_set = 0; @@ -320,7 +322,7 @@ on_auto_cbtn_toggled (GtkToggleButton *togglebutton, //screen_info->cur_crtc->changed = 1; } else { - if (!gtk_toggle_button_get_active (off_cbtn)) { + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(off_cbtn))) { gtk_widget_set_sensitive (mode_combo, TRUE); } } @@ -339,7 +341,7 @@ on_off_cbtn_toggled (GtkToggleButton *togglebutton, if (gtk_toggle_button_get_active (togglebutton)) { gtk_widget_set_sensitive (mode_combo, FALSE); - gtk_toggle_button_set_active (auto_cbtn, FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(auto_cbtn), FALSE); screen_info->cur_output->auto_set = 0; screen_info->cur_output->off_set = 1; @@ -348,7 +350,7 @@ on_off_cbtn_toggled (GtkToggleButton *togglebutton, //screen_info->cur_crtc->changed = 1; } else { - if (!gtk_toggle_button_get_active (auto_cbtn)) { + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(auto_cbtn))) { gtk_widget_set_sensitive (mode_combo, TRUE); } } @@ -398,8 +400,8 @@ on_about_btn_clicked (GtkButton *button, "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n" "THE SOFTWARE."; - gtk_show_about_dialog (root_window, - "authors", authors, + gtk_show_about_dialog (GTK_WINDOW(root_window), + "authors", authors, "comments", comments, "name", "RandR GUI", "license", license, diff --git a/src/grandr.c b/src/grandr.c index 8f0980b..4cd94e4 100644 --- a/src/grandr.c +++ b/src/grandr.c @@ -23,6 +23,7 @@ #include "support.h" #include "callbacks.h" #include <stdlib.h> +#include <string.h> #include <gconf/gconf-client.h> static Status crtc_disable (struct CrtcInfo *crtc); @@ -32,7 +33,7 @@ static Status crtc_disable (struct CrtcInfo *crtc); char * get_output_name (struct ScreenInfo *screen_info, RROutput id) { - char *output_name; + char *output_name = NULL; int i; for (i = 0; i < screen_info->n_output; i++) { @@ -51,7 +52,7 @@ get_output_name (struct ScreenInfo *screen_info, RROutput id) XRRModeInfo * find_mode_by_xid (struct ScreenInfo *screen_info, RRMode mode_id) { - XRRModeInfo *mode_info; + XRRModeInfo *mode_info = NULL; XRRScreenResources *res; int i; @@ -213,8 +214,8 @@ set_screen_size (struct ScreenInfo *screen_info) int screen; struct CrtcInfo *crtc; XRRModeInfo *mode_info; - int cur_x, cur_y; - int w, h; + int cur_x = 0, cur_y = 0; + int w = 0, h = 0; int mmW, mmH; int max_width = 0, max_height = 0; int i; @@ -405,7 +406,7 @@ apply (struct ScreenInfo *screen_info) set_positions (screen_info); if (!set_screen_size (screen_info)) { - dialog = gtk_message_dialog_new (root_window, + dialog = gtk_message_dialog_new (GTK_WINDOW(root_window), GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_CANCEL, @@ -650,16 +651,14 @@ fill_output_store (GtkListStore *store, struct ScreenInfo *screen_info, int big_ } -static char * +static gchar * get_mode_name (struct ScreenInfo *screen_info, RRMode mode_id) { XRRScreenResources *sr; - char *mode_name; - int mode_name_len = 40; + gchar *mode_name = NULL; int i; sr = screen_info->res; - mode_name = malloc (mode_name_len); for (i = 0; i < sr->nmode; i++) { if (sr->modes[i].id == mode_id) { @@ -668,16 +667,16 @@ get_mode_name (struct ScreenInfo *screen_info, RRMode mode_id) } if (i == sr->nmode) { - snprintf (mode_name, mode_name_len, "%s", "Unknown mode"); + mode_name = g_strdup ("Unknown mode"); } else { double rate; if (sr->modes[i].hTotal && sr->modes[i].vTotal) { rate = ((double) sr->modes[i].dotClock / ((double) sr->modes[i].hTotal * (double) sr->modes[i].vTotal)); - } else { + } else { rate = 0; } - snprintf (mode_name, mode_name_len, "%s%6.1fHz", sr->modes[i].name, rate); + mode_name = g_strdup_printf ("%s%6.1fHz", sr->modes[i].name, rate); } return mode_name; @@ -730,7 +729,7 @@ fill_mode_store (GtkListStore *store, struct OutputInfo *output) GtkTreeIter iter; XRROutputInfo *output_info; - char *mode_name; + gchar *mode_name; int i; int mode_index = -1; @@ -750,7 +749,7 @@ fill_mode_store (GtkListStore *store, struct OutputInfo *output) COL_MODE_NAME, mode_name, -1); mode_index++; - free (mode_name); + g_free (mode_name); if (output->cur_crtc && output->cur_crtc->cur_mode_id == output_info->modes[i]) { active_num = mode_index; @@ -1190,7 +1189,7 @@ set_positions (struct ScreenInfo *screen_info) GtkWidget *pos_iview[N_POSITIONS]; struct CrtcInfo *crtc_info; RRCrtc *crtc_list; - int list_len; + int list_len = 0; int x, y; int center_x, right_x; int center_y, below_y; diff --git a/src/grandr.h b/src/grandr.h index c00fe1a..861a4fe 100644 --- a/src/grandr.h +++ b/src/grandr.h @@ -28,7 +28,7 @@ #include "constant.h" -struct SceenInfo; +struct ScreenInfo; struct CrtcInfo { RRCrtc id; @@ -42,7 +42,7 @@ struct CrtcInfo { int changed; - struct SceenInfo *screen_info; + struct ScreenInfo *screen_info; }; struct OutputInfo { @@ -83,7 +83,7 @@ extern GtkListStore *output_store; extern GtkListStore *center_store, *left_store, *right_store, *above_store, *below_store; extern GtkListStore *mode_store; extern const guint8 big_pixbuf[], small_pixbuf[]; - +void free_screen_info (struct ScreenInfo *screen_info); GdkPixbuf* randr_create_pixbuf (const guint8 *data); struct ScreenInfo* read_screen_info (Display *); commit 17bed42409c9b133c94e3afdeb3997377139d88d Author: David Nusinow <[EMAIL PROTECTED]> Date: Wed Mar 26 19:34:17 2008 -0400 Make the XSF the maintainer with me as uploader diff --git a/debian/changelog b/debian/changelog index 180d776..f9cedb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ grandr (0.1+git20080326-1) unstable; urgency=low * New upstream pull with some minor fixes + * Make the XSF the maintainer with me as uploader - -- David Nusinow <[EMAIL PROTECTED]> Wed, 26 Mar 2008 19:28:07 -0400 + -- David Nusinow <[EMAIL PROTECTED]> Wed, 26 Mar 2008 19:33:47 -0400 grandr (0.1-3) unstable; urgency=low diff --git a/debian/control b/debian/control index 519279d..58802eb 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,8 @@ Source: grandr Section: x11 Priority: optional -Maintainer: David Nusinow <[EMAIL PROTECTED]> +Maintainer: Debian X Strike Force <debian-x@lists.debian.org> +Uploaders: David Nusinow <[EMAIL PROTECTED]> Build-Depends: debhelper (>= 5), libgtk2.0-dev, libgconf2-dev, libxrandr-dev (>= 2:1.2) Standards-Version: 3.7.2 XS-Vcs-Git: git://git.debian.org/git/pkg-xorg/app/grandr commit 872b84dea08b595a98a0e1297a1f970b5393a05f Author: David Nusinow <[EMAIL PROTECTED]> Date: Wed Mar 26 19:32:38 2008 -0400 update changelog diff --git a/debian/changelog b/debian/changelog index da453b0..180d776 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +grandr (0.1+git20080326-1) unstable; urgency=low + + * New upstream pull with some minor fixes + + -- David Nusinow <[EMAIL PROTECTED]> Wed, 26 Mar 2008 19:28:07 -0400 + grandr (0.1-3) unstable; urgency=low * Add a .desktop file courtesy of Marcelo Boveto Shima commit 0bd487e19cfc2ff0f7886aa2aab333d98edde7e9 Author: Julien Cristau <[EMAIL PROTECTED]> Date: Fri Sep 21 14:12:16 2007 +0200 Fix typo: "Outpus" -> "Outputs" diff --git a/grandr.glade b/grandr.glade index f1f0f91..6c21a17 100644 --- a/grandr.glade +++ b/grandr.glade @@ -202,7 +202,7 @@ THE SOFTWARE. <child> <widget class="GtkLabel" id="label9"> <property name="visible">True</property> - <property name="label" translatable="yes">Outpus </property> + <property name="label" translatable="yes">Outputs </property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> diff --git a/src/interface.c b/src/interface.c index 8cc1427..6ef4ab0 100644 --- a/src/interface.c +++ b/src/interface.c @@ -179,7 +179,7 @@ create_main_win (void) gtk_widget_show (vbox2); gtk_container_add (GTK_CONTAINER (viewport1), vbox2); - label9 = gtk_label_new (_("Outpus ")); + label9 = gtk_label_new (_("Outputs ")); gtk_widget_show (label9); gtk_box_pack_start (GTK_BOX (vbox2), label9, FALSE, FALSE, 0); commit ee6a9cc51dd24595687df146cf8bd1bab4085f4d Author: Keith Packard <[EMAIL PROTECTED]> Date: Fri Jun 22 00:14:18 2007 +0100 License dialog was displaying GPL, not MIT license diff --git a/src/callbacks.c b/src/callbacks.c index 788ca52..f5a4bd4 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -377,17 +377,26 @@ on_about_btn_clicked (GtkButton *button, { gchar *authors[] = {"Ming Lin ([EMAIL PROTECTED])", NULL}; gchar *comments = "This GUI is for RandR 1.2 [EMAIL PROTECTED]"; - gchar *license = "RandR GUI is free software; you can redistribute it and/or modify\n \ -it under the terms of the GNU General Public License as published by\n \ -the Free Software Foundation; either version 2 of the License, or\n \ -(at your option) any later version.\n\n\ -RandR GUI is distributed in the hope that it will be useful,\n \ -but WITHOUT ANY WARRANTY; without even the implied warranty of\n \ -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n \ -GNU General Public License for more details.\n\n\ -You should have received a copy of the GNU General Public License \n\ -along with RandR GUI; if not, write to the Free Software Foundation, Inc.,\n \ -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"; + gchar *license = +"Copyright © 2007 Intel Corporation\n" +"\n" +"Permission is hereby granted, free of charge, to any person obtaining a copy\n" +"of this software and associated documentation files (the “Software”), to deal\n" +"in the Software without restriction, including without limitation the rights\n" +"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n" +"copies of the Software, and to permit persons to whom the Software is\n" +"furnished to do so, subject to the following conditions:\n" +"\n" +"The above copyright notice and this permission notice shall be included in\n" +"all copies or substantial portions of the Software.\n" +"\n" +"THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n" +"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n" +"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n" +"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n" +"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n" +"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n" +"THE SOFTWARE."; gtk_show_about_dialog (root_window, "authors", authors, -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]