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:37:10 +0100
commitf6e3326a361afcbdec9aeff018b786bf4e346fea (patch)
tree35afd277cf21e4c1c37cd5685926bcb06dbccc6b /src/ui/tabpopup.c
parent3c2f9856d82f42a42732e1c813ac2ff339077ea6 (diff)
downloadmarco-f6e3326a361afcbdec9aeff018b786bf4e346fea.tar.bz2
marco-f6e3326a361afcbdec9aeff018b786bf4e346fea.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);
}