Webrender: Change framebuffer_size for doument

Created on 2 Jul 2018  路  6Comments  路  Source: servo/webrender

I'm working on a toy window system based on webrender. I'm trying to resize the window but I'm finding that the initial framebuffer_size does not resize with the window resize. How do I change this size on window resize?

In the examples common/boilerplate I see the initial framebuffer_size is used throughout the life of the window/renderer.

let framebuffer_size = { let (width, height) = window.get_inner_size().unwrap(); DeviceUintSize::new(width, height) }; let notifier = Box::new(Notifier::new(events_loop.create_proxy())); let (mut renderer, sender) = webrender::Renderer::new(gl.clone(), notifier, opts).unwrap(); let api = sender.create_api(); let document_id = api.add_document(framebuffer_size, 0);

Maybe I'm not calling the right function but I'm following the example multiwindow

question

All 6 comments

I think that what you are looking for is set_window_parameter.

This solves the problem, but as a result I can't extend the window beyond the size of the monitor the window is displayed on.

Weird, it limits the size of the window to the combined resolution of the monitors. I tried this on a machine with two monitors attached. Probably not webrender's issue?

I'm missing something here. set_window_parameter tells WR how to work with the window, it doesn't change the window parameters of winit in any ways. If you can't get the actual window size beyond the monitor area, the answer should be somewhere in winit.

@kvark You're right, this definitely seems to be a winit issue. Just that I stumbled upon it specifically working on my webrender example.

Alright, sounds like we can close this then. Excited to see webrender used in various places, good luck!

Was this page helpful?
0 / 5 - 0 ratings