mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
libgimpwidgets, app: add gdk_screen_get_monitor_workarea()
to the gimp3migration hack and use it where appropriate, so in the gtk3-port branch windows will not overlap with docks, panels etc.
This commit is contained in:
parent
35f8355af4
commit
bbf01ebabf
11 changed files with 32 additions and 11 deletions
|
@ -86,7 +86,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
|
|||
screen = gtk_widget_get_screen (dialog);
|
||||
monitor = gdk_screen_get_monitor_at_window (screen,
|
||||
gtk_widget_get_window (resolution_entry));
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &rect);
|
||||
|
||||
ruler_width = rect.width - 300 - (rect.width % 100);
|
||||
ruler_height = rect.height - 300 - (rect.height % 100);
|
||||
|
|
|
@ -1090,7 +1090,7 @@ gimp_image_window_new (Gimp *gimp,
|
|||
GdkRectangle rect;
|
||||
gchar geom[32];
|
||||
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &rect);
|
||||
|
||||
/* FIXME: image window placement
|
||||
*
|
||||
|
@ -1415,7 +1415,7 @@ gimp_image_window_shrink_wrap (GimpImageWindow *window,
|
|||
|
||||
monitor = gdk_screen_get_monitor_at_window (screen,
|
||||
gtk_widget_get_window (widget));
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &rect);
|
||||
|
||||
width = SCALEX (active_shell, gimp_image_get_width (image));
|
||||
height = SCALEY (active_shell, gimp_image_get_height (image));
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <gegl.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "gui-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
|
@ -348,7 +350,7 @@ gimp_ui_configurer_move_docks_to_window (GimpUIConfigurer *ui_configurer,
|
|||
screen = gtk_widget_get_screen (GTK_WIDGET (dock_columns));
|
||||
monitor = gimp_widget_get_monitor (GTK_WIDGET (dock_columns));
|
||||
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &monitor_rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &monitor_rect);
|
||||
|
||||
/* Remember the size so we can set the new dock window to the same
|
||||
* size
|
||||
|
|
|
@ -457,7 +457,7 @@ gimp_container_popup_show (GimpContainerPopup *popup,
|
|||
screen = gtk_widget_get_screen (widget);
|
||||
|
||||
monitor = gdk_screen_get_monitor_at_point (screen, orig_x, orig_y);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &rect);
|
||||
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "widgets-types.h"
|
||||
|
||||
|
@ -625,6 +626,7 @@ gimp_session_info_apply_geometry (GimpSessionInfo *info,
|
|||
gboolean apply_stored_monitor)
|
||||
{
|
||||
GdkRectangle rect;
|
||||
GdkRectangle work_rect;
|
||||
gchar geom[32];
|
||||
gint monitor;
|
||||
gint width;
|
||||
|
@ -654,6 +656,7 @@ gimp_session_info_apply_geometry (GimpSessionInfo *info,
|
|||
}
|
||||
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &work_rect);
|
||||
|
||||
info->p->x += rect.x;
|
||||
info->p->y += rect.y;
|
||||
|
@ -675,8 +678,12 @@ gimp_session_info_apply_geometry (GimpSessionInfo *info,
|
|||
height = requisition.height;
|
||||
}
|
||||
|
||||
info->p->x = CLAMP (info->p->x, rect.x, rect.x + rect.width - width);
|
||||
info->p->y = CLAMP (info->p->y, rect.y, rect.y + rect.height - height);
|
||||
info->p->x = CLAMP (info->p->x,
|
||||
work_rect.x,
|
||||
work_rect.x + work_rect.width - width);
|
||||
info->p->y = CLAMP (info->p->y,
|
||||
work_rect.y,
|
||||
work_rect.y + work_rect.height - height);
|
||||
|
||||
if (info->p->right_align && info->p->bottom_align)
|
||||
{
|
||||
|
|
|
@ -813,7 +813,7 @@ gimp_ui_manager_menu_position (GtkMenu *menu,
|
|||
&screen, &pointer_x, &pointer_y, NULL);
|
||||
|
||||
monitor = gdk_screen_get_monitor_at_point (screen, pointer_x, pointer_y);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &rect);
|
||||
|
||||
gtk_menu_set_screen (menu, screen);
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ gimp_view_popup_timeout (GimpViewPopup *popup)
|
|||
y = popup->button_y - (popup->popup_height / 2);
|
||||
|
||||
monitor = gdk_screen_get_monitor_at_point (screen, x, y);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &rect);
|
||||
|
||||
x = CLAMP (x, rect.x, rect.x + rect.width - popup->popup_width);
|
||||
y = CLAMP (y, rect.y, rect.y + rect.height - popup->popup_height);
|
||||
|
|
|
@ -91,7 +91,7 @@ gimp_menu_position (GtkMenu *menu,
|
|||
screen = gtk_widget_get_screen (widget);
|
||||
|
||||
monitor = gdk_screen_get_monitor_at_point (screen, *x, *y);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &rect);
|
||||
|
||||
gtk_menu_set_screen (menu, screen);
|
||||
|
||||
|
@ -177,7 +177,7 @@ gimp_button_menu_position (GtkWidget *button,
|
|||
screen = gtk_widget_get_screen (button);
|
||||
|
||||
monitor = gdk_screen_get_monitor_at_point (screen, *x, *y);
|
||||
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
|
||||
gdk_screen_get_monitor_workarea (screen, monitor, &rect);
|
||||
|
||||
gtk_menu_set_screen (menu, screen);
|
||||
|
||||
|
|
|
@ -206,3 +206,11 @@ gdk_cairo_get_clip_rectangle (cairo_t *cr,
|
|||
|
||||
return clip_exists;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_screen_get_monitor_workarea (GdkScreen *screen,
|
||||
gint monitor_num,
|
||||
GdkRectangle *dest)
|
||||
{
|
||||
gdk_screen_get_monitor_geometry (screen, monitor_num, dest);
|
||||
}
|
||||
|
|
|
@ -69,6 +69,9 @@ GdkModifierType gtk_widget_get_modifier_mask (GtkWidget *widget,
|
|||
|
||||
gboolean gdk_cairo_get_clip_rectangle (cairo_t *cr,
|
||||
GdkRectangle *rect);
|
||||
void gdk_screen_get_monitor_workarea (GdkScreen *screen,
|
||||
gint monitor_num,
|
||||
GdkRectangle *dest);
|
||||
|
||||
|
||||
#endif /* __GIMP_3_MIGRATION_H__ */
|
||||
|
|
|
@ -2,6 +2,7 @@ EXPORTS
|
|||
gdk_cairo_get_clip_rectangle
|
||||
gdk_event_triggers_context_menu
|
||||
gdk_keymap_get_modifier_mask
|
||||
gdk_screen_get_monitor_workarea
|
||||
gimp_aspect_type_get_type
|
||||
gimp_browser_add_search_types
|
||||
gimp_browser_get_type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue