Skip to content
Snippets Groups Projects
Select Git revision
  • 6570d0c4b7a1868ad8af4e61dd5f50bf826d9c76
  • for-vairdraw default protected
  • multi-context-windows
3 results

wl_window.c

Blame
    • Camilla Löwy's avatar
      6570d0c4
      Add glfwSetWindowMonitor · 6570d0c4
      Camilla Löwy authored
      This adds the ability to switch between windowed and full screen modes,
      move a full screen window between monitors and update its desired
      resolution and refresh rate.
      
      Fixes #43.
      6570d0c4
      History
      Add glfwSetWindowMonitor
      Camilla Löwy authored
      This adds the ability to switch between windowed and full screen modes,
      move a full screen window between monitors and update its desired
      resolution and refresh rate.
      
      Fixes #43.
    wl_window.c 27.01 KiB
    //========================================================================
    // GLFW 3.2 Wayland - www.glfw.org
    //------------------------------------------------------------------------
    // Copyright (c) 2014 Jonas Ådahl <jadahl@gmail.com>
    //
    // This software is provided 'as-is', without any express or implied
    // warranty. In no event will the authors be held liable for any damages
    // arising from the use of this software.
    //
    // Permission is granted to anyone to use this software for any purpose,
    // including commercial applications, and to alter it and redistribute it
    // freely, subject to the following restrictions:
    //
    // 1. The origin of this software must not be misrepresented; you must not
    //    claim that you wrote the original software. If you use this software
    //    in a product, an acknowledgment in the product documentation would
    //    be appreciated but is not required.
    //
    // 2. Altered source versions must be plainly marked as such, and must not
    //    be misrepresented as being the original software.
    //
    // 3. This notice may not be removed or altered from any source
    //    distribution.
    //
    //========================================================================
    
    #define _GNU_SOURCE
    
    #include "internal.h"
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <errno.h>
    #include <unistd.h>
    #include <string.h>
    #include <fcntl.h>
    #include <sys/mman.h>
    #include <poll.h>
    
    #include <wayland-egl.h>
    #include <wayland-cursor.h>
    
    
    static void handlePing(void* data,
                           struct wl_shell_surface* shellSurface,
                           uint32_t serial)
    {
        wl_shell_surface_pong(shellSurface, serial);
    }
    
    static void handleConfigure(void* data,
                                struct wl_shell_surface* shellSurface,
                                uint32_t edges,
                                int32_t width,
                                int32_t height)
    {
        _GLFWwindow* window = data;
        _glfwInputFramebufferSize(window, width, height);
        _glfwInputWindowSize(window, width, height);
        _glfwPlatformSetWindowSize(window, width, height);
        _glfwInputWindowDamage(window);
    }
    
    static void handlePopupDone(void* data,
                                struct wl_shell_surface* shellSurface)
    {
    }
    
    static const struct wl_shell_surface_listener shellSurfaceListener = {
        handlePing,