Skip to content

Commit 0794d2a

Browse files
sonnyplw64
authored andcommitted
Fix CSS provider priority (#800)
1 parent f6d5bc5 commit 0794d2a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Previewer/Internal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ export default function Internal({
215215
Gtk.StyleContext.add_provider_for_display(
216216
output.get_display(),
217217
css_provider,
218-
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION,
218+
// STYLE_PROVIDER_PRIORITY_THEME is 200; only values below that behave correctly
219+
Gtk.STYLE_PROVIDER_PRIORITY_THEME - 1,
219220
);
220221
}
221222

src/Previewer/previewer.vala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ namespace Workbench {
125125
this.css_parser_error(error.message, (int)start.lines, (int)start.line_chars, (int)end.lines, (int)end.line_chars);
126126
});
127127
this.css.load_from_data (content.data);
128-
Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), this.css , Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
128+
Gtk.StyleContext.add_provider_for_display (
129+
Gdk.Display.get_default (),
130+
this.css,
131+
// STYLE_PROVIDER_PRIORITY_THEME is 200; only values below that behave correctly
132+
Gtk.STYLE_PROVIDER_PRIORITY_THEME - 1);
129133
}
130134

131135
public void run (string filename, string uri) {

0 commit comments

Comments
 (0)