summaryrefslogtreecommitdiff
path: root/src/ui/tabpopup.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2018-03-21 15:52:13 -0400
committerraveit65 <[email protected]>2018-03-22 11:53:26 +0100
commitb9fd3c1c0a252051ba9cad18e8427511f240d5da (patch)
tree0262343f70cca8ade47bf3ca973bb6913b407939 /src/ui/tabpopup.c
parent61686208e5acd2867c14370c751efb2b07eba537 (diff)
downloadmarco-b9fd3c1c0a252051ba9cad18e8427511f240d5da.tar.bz2
marco-b9fd3c1c0a252051ba9cad18e8427511f240d5da.tar.xz
Support HiDPI window decorations
Diffstat (limited to 'src/ui/tabpopup.c')
-rw-r--r--src/ui/tabpopup.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c
index f3d14240..933f6cb0 100644
--- a/src/ui/tabpopup.c
+++ b/src/ui/tabpopup.c
@@ -148,8 +148,8 @@ dimm_icon (GdkPixbuf *pixbuf)
static TabEntry*
tab_entry_new (const MetaTabEntry *entry,
- gint screen_width,
- gboolean outline)
+ gboolean outline,
+ gint scale)
{
TabEntry *te;
@@ -200,15 +200,15 @@ tab_entry_new (const MetaTabEntry *entry,
if (outline)
{
- te->rect.x = entry->rect.x;
- te->rect.y = entry->rect.y;
- te->rect.width = entry->rect.width;
- te->rect.height = entry->rect.height;
-
- te->inner_rect.x = entry->inner_rect.x;
- te->inner_rect.y = entry->inner_rect.y;
- te->inner_rect.width = entry->inner_rect.width;
- te->inner_rect.height = entry->inner_rect.height;
+ te->rect.x = entry->rect.x / scale;
+ te->rect.y = entry->rect.y / scale;
+ te->rect.width = entry->rect.width / scale;
+ te->rect.height = entry->rect.height / scale;
+
+ te->inner_rect.x = entry->inner_rect.x / scale;
+ te->inner_rect.y = entry->inner_rect.y / scale;
+ te->inner_rect.width = entry->inner_rect.width / scale;
+ te->inner_rect.height = entry->inner_rect.height / scale;
}
return te;
}
@@ -229,7 +229,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
int max_label_width; /* the actual max width of the labels we create */
AtkObject *obj;
GdkScreen *screen;
- int screen_width;
+ int screen_width, scale;
popup = g_new (MetaTabPopup, 1);
@@ -260,11 +260,11 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
popup->current_selected_entry = NULL;
popup->border = border;
+ scale = gtk_widget_get_scale_factor (GTK_WIDGET (popup->window));
screen_width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen));
for (i = 0; i < entry_count; ++i)
{
- TabEntry* new_entry = tab_entry_new (&entries[i], screen_width,
- border & BORDER_OUTLINE_WINDOW);
+ TabEntry* new_entry = tab_entry_new (&entries[i], border & BORDER_OUTLINE_WINDOW, scale);
popup->entries = g_list_prepend (popup->entries, new_entry);
}