Only allow x11 for now

This commit is contained in:
dec05eba
2024-09-11 19:51:57 +02:00
parent c6942aaa9a
commit 7d6732a7d3
5 changed files with 17 additions and 9 deletions

6
TODO
View File

@@ -33,8 +33,10 @@ Move hotkey to gsr-overlay-daemon which should execute gpu-screen-recorder --inf
Combobox shouldn't show all items if its the combobox at the bottom and scrolling is needed to show them all.
Filechooser should have the option to select list view, search bar and common folders/mounted drives on the left side for quick navigation.
Filechooser should have the option to select list view, search bar and common folders/mounted drives on the left side for quick navigation. Also a button to create a new directory.
Start recording/replay/streaming with correct data from settings.
Save recording/replay/streaming status to file.
Save gsr info data to file to quick re-open.
Save gsr info data to file to quick re-open.
Support wayland (excluding gnome, or force xwayland on gnome).

View File

@@ -80,6 +80,8 @@ int main(void) {
pid_t overlay_pid = -1;
fprintf(stderr, "gsr overlay is now ready, waiting for inputs. Press alt+z to show/hide the overlay\n");
XEvent xev;
for(;;) {
XNextEvent(display, &xev);

View File

@@ -28,6 +28,7 @@ namespace gsr {
static const float content_padding_right_scale = 0.03f;
static const float content_margin_left_scale = 0.005f;
static const float content_margin_right_scale = 0.005f;
static const float folder_text_spacing_scale = 0.005f;
static const float up_button_spacing_scale = 0.01f;
FileChooserBody::FileChooserBody(FileChooser *file_chooser, mgl::vec2f size) :
@@ -84,8 +85,8 @@ namespace gsr {
auto &folder = folders[i];
mgl::Sprite folder_sprite(&get_theme().folder_texture);
folder_sprite.set_position(folder_pos.floor());
folder_sprite.set_width((int)folder_width);
folder_sprite.set_position((folder_pos - mgl::vec2f(0.0f, folder_sprite.get_size().y * 0.3f)).floor());
const mgl::vec2f item_pos = folder_pos - mgl::vec2f(content_padding_left, content_padding_top);
const mgl::vec2f item_size = folder_sprite.get_size() + mgl::vec2f(content_padding_left + content_padding_right, content_padding_top + content_padding_bottom);
@@ -111,7 +112,7 @@ namespace gsr {
// TODO: Dont allow text to go further left/right than item_pos (on the left side) and item_pos + item_size (on the right side).
folder.text.set_max_width(item_size.x);
folder.text.set_max_rows(2);
folder.text.set_position(folder_sprite.get_position() + mgl::vec2f(folder_sprite.get_size().x * 0.5f - folder.text.get_bounds().size.x * 0.5f, folder_sprite.get_size().y));
folder.text.set_position((folder_sprite.get_position() + mgl::vec2f(folder_sprite.get_size().x * 0.5f - folder.text.get_bounds().size.x * 0.5f, folder_sprite.get_size().y + folder_text_spacing_scale * get_theme().window_height)).floor());
window.draw(folder.text);
}

View File

@@ -486,7 +486,7 @@ namespace gsr {
audio_codec_ptr->set_visible(advanced_view);
video_codec_ptr->set_visible(advanced_view);
framerate_mode_list_ptr->set_visible(advanced_view);
notifications_subsection_ptr->set_visible(advanced_view);
//notifications_subsection_ptr->set_visible(advanced_view);
settings_scrollable_page_ptr->reset_scroll();
};
view_radio_button_ptr->on_selection_changed("Simple", "simple");
@@ -521,7 +521,7 @@ namespace gsr {
audio_codec_ptr->set_visible(advanced_view);
video_codec_ptr->set_visible(advanced_view);
framerate_mode_list_ptr->set_visible(advanced_view);
notifications_subsection_ptr->set_visible(advanced_view);
//notifications_subsection_ptr->set_visible(advanced_view);
settings_scrollable_page_ptr->reset_scroll();
};
view_radio_button_ptr->on_selection_changed("Simple", "simple");
@@ -574,9 +574,7 @@ namespace gsr {
std::unique_ptr<ComboBox> SettingsPage::create_stream_container_box() {
auto container_box = std::make_unique<ComboBox>(&get_theme().body_font);
container_box->add_item("mp4", "mp4");
container_box->add_item("mkv", "matroska");
container_box->add_item("flv", "flv");
container_box->add_item("mov", "mov");
container_box->add_item("ts", "mpegts");
container_box->add_item("m3u8", "hls");
container_box_ptr = container_box.get();
@@ -635,7 +633,7 @@ namespace gsr {
audio_codec_ptr->set_visible(advanced_view);
video_codec_ptr->set_visible(advanced_view);
framerate_mode_list_ptr->set_visible(advanced_view);
notifications_subsection_ptr->set_visible(advanced_view);
//notifications_subsection_ptr->set_visible(advanced_view);
settings_scrollable_page_ptr->reset_scroll();
};
view_radio_button_ptr->on_selection_changed("Simple", "simple");

View File

@@ -63,6 +63,11 @@ int main(int argc, char **argv) {
exit(1);
}
if(gsr_info.system_info.display_server == gsr::DisplayServer::WAYLAND) {
fprintf(stderr, "error: Wayland is currently not supported\n");
exit(1);
}
std::string resources_path;
if(access("images/gpu_screen_recorder_logo.png", F_OK) == 0) {
resources_path = "./";