[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][debian-mate-team/mate-settings-daemon][master] Add 0001_new_video_key.patch. Have 'Super+P' trigger a video mode switch....



Title: GitLab

Martin Wimpress pushed to branch master at Debian and Ubuntu MATE Packaging Team / mate-settings-daemon

Commits:

2 changed files:

Changes:

  • debian/patches/0001_new_video_key.patch
    1
    +Author: Martin Wimpress <code@flexion.org>
    
    2
    +Description: Have "Super+P" trigger a video mode switch.
    
    3
    +
    
    4
    +diff --git a/plugins/xrandr/msd-xrandr-manager.c b/plugins/xrandr/msd-xrandr-manager.c
    
    5
    +index fff0c9b..cf66863 100644
    
    6
    +--- a/plugins/xrandr/msd-xrandr-manager.c
    
    7
    ++++ b/plugins/xrandr/msd-xrandr-manager.c
    
    8
    +@@ -64,6 +64,8 @@
    
    9
    + 
    
    10
    + #define VIDEO_KEYSYM    "XF86Display"
    
    11
    + #define ROTATE_KEYSYM   "XF86RotateWindows"
    
    12
    ++#define NEW_VIDEO_KEYSYM    "p"
    
    13
    ++#define NEW_VIDEO_MODSYM    Mod4Mask
    
    14
    + 
    
    15
    + /* Number of seconds that the confirmation dialog will last before it resets the
    
    16
    +  * RANDR configuration to its old state.
    
    17
    +@@ -88,6 +90,11 @@ struct MsdXrandrManagerPrivate
    
    18
    +         /* Key code of the XF86Display key (Fn-F7 on Thinkpads, Fn-F4 on HP machines, etc.) */
    
    19
    +         guint switch_video_mode_keycode;
    
    20
    + 
    
    21
    ++        /* Key code of a new video mode key (F1 on Dell machines).
    
    22
    ++           It looks like Mod4+P. */
    
    23
    ++        guint new_switch_video_mode_keycode;
    
    24
    ++        guint new_switch_video_mode_modifier;
    
    25
    ++
    
    26
    +         /* Key code of the XF86RotateWindows key (present on some tablets) */
    
    27
    +         guint rotate_windows_keycode;
    
    28
    + 
    
    29
    +@@ -1374,7 +1381,9 @@ event_filter (GdkXEvent           *xevent,
    
    30
    +                 return GDK_FILTER_CONTINUE;
    
    31
    + 
    
    32
    +         if (xev->xany.type == KeyPress) {
    
    33
    +-                if (xev->xkey.keycode == manager->priv->switch_video_mode_keycode)
    
    34
    ++                if (xev->xkey.keycode == manager->priv->switch_video_mode_keycode ||
    
    35
    ++                    (xev->xkey.keycode == manager->priv->new_switch_video_mode_keycode &&
    
    36
    ++                     xev->xkey.state & manager->priv->new_switch_video_mode_modifier))
    
    37
    +                         handle_fn_f7 (manager, xev->xkey.time);
    
    38
    +                 else if (xev->xkey.keycode == manager->priv->rotate_windows_keycode)
    
    39
    +                         handle_rotate_windows (manager, xev->xkey.time);
    
    40
    +@@ -2574,6 +2583,21 @@ msd_xrandr_manager_start (MsdXrandrManager *manager,
    
    41
    +                 gdk_x11_display_error_trap_pop_ignored (display);
    
    42
    +         }
    
    43
    + 
    
    44
    ++        if (manager->priv->new_switch_video_mode_keycode &&
    
    45
    ++            manager->priv->new_switch_video_mode_modifier) {
    
    46
    ++                gdk_x11_display_error_trap_push (display);
    
    47
    ++
    
    48
    ++                XGrabKey (gdk_x11_get_default_xdisplay(),
    
    49
    ++                          manager->priv->new_switch_video_mode_keycode,
    
    50
    ++                          manager->priv->new_switch_video_mode_modifier,
    
    51
    ++                          gdk_x11_get_default_root_xwindow(),
    
    52
    ++                          True, GrabModeAsync, GrabModeAsync);
    
    53
    ++
    
    54
    ++                gdk_display_flush (display);
    
    55
    ++                gdk_x11_display_error_trap_pop_ignored (display);
    
    56
    ++        }
    
    57
    ++
    
    58
    ++
    
    59
    +         if (manager->priv->rotate_windows_keycode) {
    
    60
    +                 gdk_x11_display_error_trap_push (display);
    
    61
    + 
    
    62
    +@@ -2629,6 +2653,18 @@ msd_xrandr_manager_stop (MsdXrandrManager *manager)
    
    63
    +                 gdk_x11_display_error_trap_pop_ignored (display);
    
    64
    +         }
    
    65
    + 
    
    66
    ++        if (manager->priv->new_switch_video_mode_keycode &&
    
    67
    ++            manager->priv->new_switch_video_mode_modifier) {
    
    68
    ++                gdk_x11_display_error_trap_push (display);
    
    69
    ++
    
    70
    ++                XUngrabKey (gdk_x11_get_default_xdisplay(),
    
    71
    ++                            manager->priv->new_switch_video_mode_keycode,
    
    72
    ++                            manager->priv->new_switch_video_mode_modifier,
    
    73
    ++                            gdk_x11_get_default_root_xwindow());
    
    74
    ++
    
    75
    ++                gdk_x11_display_error_trap_pop_ignored (display);
    
    76
    ++        }
    
    77
    ++
    
    78
    +         if (manager->priv->rotate_windows_keycode) {
    
    79
    +                 gdk_x11_display_error_trap_push (display);
    
    80
    + 
    
    81
    +@@ -2695,6 +2731,10 @@ msd_xrandr_manager_init (MsdXrandrManager *manager)
    
    82
    +         manager->priv = MSD_XRANDR_MANAGER_GET_PRIVATE (manager);
    
    83
    + 
    
    84
    +         manager->priv->switch_video_mode_keycode = get_keycode_for_keysym_name (VIDEO_KEYSYM);
    
    85
    ++        manager->priv->new_switch_video_mode_keycode = get_keycode_for_keysym_name (NEW_VIDEO_KEYSYM);
    
    86
    ++        manager->priv->new_switch_video_mode_modifier = NEW_VIDEO_MODSYM;
    
    87
    ++        manager->priv->new_switch_video_mode_keycode = get_keycode_for_keysym_name (NEW_VIDEO_KEYSYM);
    
    88
    ++        manager->priv->new_switch_video_mode_modifier = NEW_VIDEO_MODSYM;
    
    89
    +         manager->priv->rotate_windows_keycode = get_keycode_for_keysym_name (ROTATE_KEYSYM);
    
    90
    + 
    
    91
    +         manager->priv->current_fn_f7_config = -1;

  • debian/patches/series
    1
    +0001_new_video_key.patch


  • Reply to: