mirror of https://github.com/GNOME/gimp.git
app/display/gimpdisplayshell-callbacks.c app/display/gimpdisplayshell.c
2003-09-09 Sven Neumann <sven@gimp.org> * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationview.c * app/gui/resolution-calibrate-dialog.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpwidgets-utils.c: get the size from the current screen, not always from the default one. * plug-ins/common/wmf.c: ask GIMP for the monitor resolution instead of taking the value from GDK.
This commit is contained in:
parent
284b8f91d7
commit
56438a7b9b
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2003-09-09 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/display/gimpdisplayshell-callbacks.c
|
||||
* app/display/gimpdisplayshell.c
|
||||
* app/display/gimpnavigationview.c
|
||||
* app/gui/resolution-calibrate-dialog.c
|
||||
* app/widgets/gimpcontainerpopup.c
|
||||
* app/widgets/gimpdialogfactory.c
|
||||
* app/widgets/gimpeditor.c
|
||||
* app/widgets/gimppreview-popup.c
|
||||
* app/widgets/gimpwidgets-utils.c: get the size from the current
|
||||
screen, not always from the default one.
|
||||
|
||||
* plug-ins/common/wmf.c: ask GIMP for the monitor resolution instead
|
||||
of taking the value from GDK.
|
||||
|
||||
2003-09-09 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/core/gimp.[ch]: added "gboolean console_messages" to the
|
||||
|
|
|
@ -102,6 +102,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
|
|||
GtkWidget *darea;
|
||||
GtkWidget *ruler;
|
||||
GtkWidget *label;
|
||||
GdkScreen *screen;
|
||||
GList *list;
|
||||
|
||||
g_return_if_fail (GIMP_IS_SIZE_ENTRY (resolution_entry));
|
||||
|
@ -139,8 +140,10 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
|
|||
SET_STYLE (dialog, dialog_style);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 8);
|
||||
|
||||
ruler_width = gdk_screen_width ();
|
||||
ruler_height = gdk_screen_height ();
|
||||
screen = gtk_widget_get_screen (dialog);
|
||||
|
||||
ruler_width = gdk_screen_get_width (screen);
|
||||
ruler_height = gdk_screen_get_height (screen);
|
||||
|
||||
ruler_width = ruler_width - 300 - (ruler_width % 100);
|
||||
ruler_height = ruler_height - 300 - (ruler_height % 100);
|
||||
|
|
|
@ -1641,6 +1641,7 @@ gimp_display_shell_origin_menu_position (GtkMenu *menu,
|
|||
gpointer data)
|
||||
{
|
||||
GtkWidget *origin;
|
||||
GdkScreen *screen;
|
||||
gint origin_x;
|
||||
gint origin_y;
|
||||
|
||||
|
@ -1651,10 +1652,12 @@ gimp_display_shell_origin_menu_position (GtkMenu *menu,
|
|||
*x = origin_x + origin->allocation.x + origin->allocation.width - 1;
|
||||
*y = origin_y + origin->allocation.y + (origin->allocation.height - 1) / 2;
|
||||
|
||||
if (*x + GTK_WIDGET (menu)->allocation.width > gdk_screen_width ())
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
|
||||
|
||||
if (*x + GTK_WIDGET (menu)->allocation.width > gdk_screen_get_width (screen))
|
||||
*x -= (GTK_WIDGET (menu)->allocation.width + origin->allocation.width);
|
||||
|
||||
if (*y + GTK_WIDGET (menu)->allocation.height > gdk_screen_height ())
|
||||
if (*y + GTK_WIDGET (menu)->allocation.height > gdk_screen_get_height (screen))
|
||||
*y -= (GTK_WIDGET (menu)->allocation.height);
|
||||
}
|
||||
|
||||
|
|
|
@ -488,6 +488,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
|||
GtkWidget *arrow;
|
||||
GtkWidget *image;
|
||||
GtkWidget *menubar;
|
||||
GdkScreen *screen;
|
||||
gint image_width, image_height;
|
||||
gint n_width, n_height;
|
||||
gint s_width, s_height;
|
||||
|
@ -528,8 +529,10 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
|||
* value is the same as in gimp_display_shell_shrink_wrap. It
|
||||
* probably should be a user-configurable option.
|
||||
*/
|
||||
s_width = gdk_screen_width () * 0.75;
|
||||
s_height = gdk_screen_height () * 0.75;
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
|
||||
|
||||
s_width = gdk_screen_get_width (screen) * 0.75;
|
||||
s_height = gdk_screen_get_height (screen) * 0.75;
|
||||
|
||||
scalesrc = SCALESRC (shell);
|
||||
scaledest = SCALEDEST (shell);
|
||||
|
@ -1592,6 +1595,7 @@ gimp_display_shell_draw_cursor (GimpDisplayShell *shell)
|
|||
void
|
||||
gimp_display_shell_shrink_wrap (GimpDisplayShell *shell)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
gint disp_width, disp_height;
|
||||
gint width, height;
|
||||
gint shell_width, shell_height;
|
||||
|
@ -1600,8 +1604,10 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell)
|
|||
gint s_width, s_height;
|
||||
gboolean resize = FALSE;
|
||||
|
||||
s_width = gdk_screen_width ();
|
||||
s_height = gdk_screen_height ();
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
|
||||
|
||||
s_width = gdk_screen_get_width (screen);
|
||||
s_height = gdk_screen_get_height (screen);
|
||||
|
||||
width = SCALEX (shell, shell->gdisp->gimage->width);
|
||||
height = SCALEY (shell, shell->gdisp->gimage->height);
|
||||
|
|
|
@ -488,6 +488,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
|||
GtkWidget *arrow;
|
||||
GtkWidget *image;
|
||||
GtkWidget *menubar;
|
||||
GdkScreen *screen;
|
||||
gint image_width, image_height;
|
||||
gint n_width, n_height;
|
||||
gint s_width, s_height;
|
||||
|
@ -528,8 +529,10 @@ gimp_display_shell_new (GimpDisplay *gdisp,
|
|||
* value is the same as in gimp_display_shell_shrink_wrap. It
|
||||
* probably should be a user-configurable option.
|
||||
*/
|
||||
s_width = gdk_screen_width () * 0.75;
|
||||
s_height = gdk_screen_height () * 0.75;
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
|
||||
|
||||
s_width = gdk_screen_get_width (screen) * 0.75;
|
||||
s_height = gdk_screen_get_height (screen) * 0.75;
|
||||
|
||||
scalesrc = SCALESRC (shell);
|
||||
scaledest = SCALEDEST (shell);
|
||||
|
@ -1592,6 +1595,7 @@ gimp_display_shell_draw_cursor (GimpDisplayShell *shell)
|
|||
void
|
||||
gimp_display_shell_shrink_wrap (GimpDisplayShell *shell)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
gint disp_width, disp_height;
|
||||
gint width, height;
|
||||
gint shell_width, shell_height;
|
||||
|
@ -1600,8 +1604,10 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell)
|
|||
gint s_width, s_height;
|
||||
gboolean resize = FALSE;
|
||||
|
||||
s_width = gdk_screen_width ();
|
||||
s_height = gdk_screen_height ();
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
|
||||
|
||||
s_width = gdk_screen_get_width (screen);
|
||||
s_height = gdk_screen_get_height (screen);
|
||||
|
||||
width = SCALEX (shell, shell->gdisp->gimage->width);
|
||||
height = SCALEY (shell, shell->gdisp->gimage->height);
|
||||
|
|
|
@ -257,6 +257,7 @@ gimp_navigation_view_popup (GimpDisplayShell *shell,
|
|||
{
|
||||
GimpNavigationView *view;
|
||||
GimpNavigationPreview *preview;
|
||||
GdkScreen *screen;
|
||||
gint x, y;
|
||||
gint x_org, y_org;
|
||||
|
||||
|
@ -318,10 +319,13 @@ gimp_navigation_view_popup (GimpDisplayShell *shell,
|
|||
*
|
||||
* Warping the pointer would be another solution ...
|
||||
*/
|
||||
x = CLAMP (x, 0, (gdk_screen_width () -
|
||||
|
||||
screen = gtk_widget_get_screen (widget);
|
||||
|
||||
x = CLAMP (x, 0, (gdk_screen_get_width (screen) -
|
||||
GIMP_PREVIEW (preview)->renderer->width -
|
||||
4 * widget->style->xthickness));
|
||||
y = CLAMP (y, 0, (gdk_screen_height () -
|
||||
y = CLAMP (y, 0, (gdk_screen_get_height (screen) -
|
||||
GIMP_PREVIEW (preview)->renderer->height -
|
||||
4 * widget->style->ythickness));
|
||||
|
||||
|
|
|
@ -257,6 +257,7 @@ gimp_navigation_view_popup (GimpDisplayShell *shell,
|
|||
{
|
||||
GimpNavigationView *view;
|
||||
GimpNavigationPreview *preview;
|
||||
GdkScreen *screen;
|
||||
gint x, y;
|
||||
gint x_org, y_org;
|
||||
|
||||
|
@ -318,10 +319,13 @@ gimp_navigation_view_popup (GimpDisplayShell *shell,
|
|||
*
|
||||
* Warping the pointer would be another solution ...
|
||||
*/
|
||||
x = CLAMP (x, 0, (gdk_screen_width () -
|
||||
|
||||
screen = gtk_widget_get_screen (widget);
|
||||
|
||||
x = CLAMP (x, 0, (gdk_screen_get_width (screen) -
|
||||
GIMP_PREVIEW (preview)->renderer->width -
|
||||
4 * widget->style->xthickness));
|
||||
y = CLAMP (y, 0, (gdk_screen_height () -
|
||||
y = CLAMP (y, 0, (gdk_screen_get_height (screen) -
|
||||
GIMP_PREVIEW (preview)->renderer->height -
|
||||
4 * widget->style->ythickness));
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
|
|||
GtkWidget *darea;
|
||||
GtkWidget *ruler;
|
||||
GtkWidget *label;
|
||||
GdkScreen *screen;
|
||||
GList *list;
|
||||
|
||||
g_return_if_fail (GIMP_IS_SIZE_ENTRY (resolution_entry));
|
||||
|
@ -139,8 +140,10 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
|
|||
SET_STYLE (dialog, dialog_style);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 8);
|
||||
|
||||
ruler_width = gdk_screen_width ();
|
||||
ruler_height = gdk_screen_height ();
|
||||
screen = gtk_widget_get_screen (dialog);
|
||||
|
||||
ruler_width = gdk_screen_get_width (screen);
|
||||
ruler_height = gdk_screen_get_height (screen);
|
||||
|
||||
ruler_width = ruler_width - 300 - (ruler_width % 100);
|
||||
ruler_height = ruler_height - 300 - (ruler_height % 100);
|
||||
|
|
|
@ -421,6 +421,7 @@ gimp_container_popup_show (GimpContainerPopup *popup,
|
|||
GtkWidget *widget)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
GdkScreen *screen;
|
||||
gint orig_x;
|
||||
gint orig_y;
|
||||
gint scr_width;
|
||||
|
@ -440,8 +441,10 @@ gimp_container_popup_show (GimpContainerPopup *popup,
|
|||
orig_y += widget->allocation.y;
|
||||
}
|
||||
|
||||
scr_width = gdk_screen_width ();
|
||||
scr_height = gdk_screen_height ();
|
||||
screen = gtk_widget_get_screen (widget);
|
||||
|
||||
scr_width = gdk_screen_get_width (screen);
|
||||
scr_height = gdk_screen_get_height (screen);
|
||||
|
||||
x = orig_x;
|
||||
y = orig_y + widget->allocation.height;
|
||||
|
|
|
@ -202,6 +202,7 @@ gimp_editor_menu_position (GtkMenu *menu,
|
|||
{
|
||||
GtkRequisition requisition;
|
||||
GtkWidget *editor;
|
||||
GdkScreen *screen;
|
||||
gint editor_x;
|
||||
gint editor_y;
|
||||
|
||||
|
@ -214,13 +215,15 @@ gimp_editor_menu_position (GtkMenu *menu,
|
|||
*x = editor_x + editor->allocation.x + 2;
|
||||
*y = editor_y + editor->allocation.y + 2;
|
||||
|
||||
if (*x + requisition.width > gdk_screen_width ())
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
|
||||
|
||||
if (*x + requisition.width > gdk_screen_get_width (screen))
|
||||
*x -= requisition.width;
|
||||
|
||||
if (*x < 0)
|
||||
*x = 0;
|
||||
|
||||
if (*y + requisition.height > gdk_screen_height ())
|
||||
if (*y + requisition.height > gdk_screen_get_height (screen))
|
||||
*y -= requisition.height;
|
||||
|
||||
if (*y < 0)
|
||||
|
|
|
@ -171,6 +171,7 @@ gimp_preview_popup_timeout (GimpPreviewPopup *popup)
|
|||
GtkWidget *window;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *preview;
|
||||
GdkScreen *screen;
|
||||
gint orig_x;
|
||||
gint orig_y;
|
||||
gint scr_width;
|
||||
|
@ -198,8 +199,10 @@ gimp_preview_popup_timeout (GimpPreviewPopup *popup)
|
|||
gtk_widget_show (preview);
|
||||
|
||||
gdk_window_get_origin (popup->widget->window, &orig_x, &orig_y);
|
||||
scr_width = gdk_screen_width ();
|
||||
scr_height = gdk_screen_height ();
|
||||
|
||||
screen = gtk_widget_get_screen (popup->widget);
|
||||
scr_width = gdk_screen_get_width (screen);
|
||||
scr_height = gdk_screen_get_height (screen);
|
||||
|
||||
x = orig_x + popup->button_x - (popup->popup_width >> 1);
|
||||
y = orig_y + popup->button_y - (popup->popup_height >> 1);
|
||||
|
|
|
@ -171,6 +171,7 @@ gimp_preview_popup_timeout (GimpPreviewPopup *popup)
|
|||
GtkWidget *window;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *preview;
|
||||
GdkScreen *screen;
|
||||
gint orig_x;
|
||||
gint orig_y;
|
||||
gint scr_width;
|
||||
|
@ -198,8 +199,10 @@ gimp_preview_popup_timeout (GimpPreviewPopup *popup)
|
|||
gtk_widget_show (preview);
|
||||
|
||||
gdk_window_get_origin (popup->widget->window, &orig_x, &orig_y);
|
||||
scr_width = gdk_screen_width ();
|
||||
scr_height = gdk_screen_height ();
|
||||
|
||||
screen = gtk_widget_get_screen (popup->widget);
|
||||
scr_width = gdk_screen_get_width (screen);
|
||||
scr_height = gdk_screen_get_height (screen);
|
||||
|
||||
x = orig_x + popup->button_x - (popup->popup_width >> 1);
|
||||
y = orig_y + popup->button_y - (popup->popup_height >> 1);
|
||||
|
|
|
@ -246,6 +246,7 @@ gimp_menu_position (GtkMenu *menu,
|
|||
gpointer data)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
GdkScreen *screen;
|
||||
gint pointer_x;
|
||||
gint pointer_y;
|
||||
gint screen_width;
|
||||
|
@ -259,8 +260,10 @@ gimp_menu_position (GtkMenu *menu,
|
|||
|
||||
gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
|
||||
|
||||
screen_width = gdk_screen_width () + 2;
|
||||
screen_height = gdk_screen_height () + 2;
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
|
||||
|
||||
screen_width = gdk_screen_get_width (screen) + 2;
|
||||
screen_height = gdk_screen_get_height (screen) + 2;
|
||||
|
||||
*x = CLAMP (pointer_x, 2, MAX (0, screen_width - requisition.width));
|
||||
*y = CLAMP (pointer_y, 2, MAX (0, screen_height - requisition.height));
|
||||
|
|
|
@ -1104,6 +1104,7 @@ load_image (const gchar *filename)
|
|||
GdkColor *colors;
|
||||
guchar *rtbl, *gtbl, *btbl;
|
||||
guint rmask, gmask, bmask, rshift, gshift, bshift;
|
||||
gdouble xres, yres;
|
||||
|
||||
int argc;
|
||||
char **argv;
|
||||
|
@ -1174,11 +1175,9 @@ load_image (const gchar *filename)
|
|||
window.org_x = window.org_y = 0;
|
||||
window.valid = FALSE;
|
||||
|
||||
#ifdef GTK_HAVE_FEATURES_1_1_2
|
||||
pixs_per_in = (int) (25.4 * gdk_screen_width () / gdk_screen_width_mm ());
|
||||
#else
|
||||
pixs_per_in = 72;
|
||||
#endif
|
||||
gimp_get_monitor_resolution (&xres, &yres);
|
||||
pixs_per_in = (int) ((xres + yres) / 2.0);
|
||||
|
||||
#ifdef DEBUG
|
||||
g_print ("pixs_per_in: %d\n", pixs_per_in);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue